using System.Windows.Forms;
using System.Drawing;
using Drawing3d;
namespace Sample
{
public partial class Form1 : Form
{
MyDevice Device = new MyDevice();
public Form1()
{
InitializeComponent();
Device.WinControl = this;
}
}
public class MyDevice:OpenGlDevice
{
Texture TPicture = new Texture();
Texture TEnvironment = new Texture();
public override void OnPaint()
{
base.OnPaint();
Translucent = 1;
Emission = Color.White; // macht die Sache heller
texture = TPicture;
PolygonMode = PolygonMode.Fill;
drawBox(new xyz(-6, -4, 0), new xyz(12, 8, 0));
// Hintergrund halbdurchsichtig
Translucent = 0.4;
Emission = Color.DarkGreen;
texture = TEnvironment;
drawBox( new xyz(-6, -4, 0), new xyz(12, 8, 0.5));
}
protected override void OnCreated()
{
base.OnCreated();
BackColor = Color.White;
TPicture.LoadFromFile("Fishes.jpg");
TEnvironment.LoadFromFile("reflection.jpg");
TPicture.WorldHeight = 8;
TPicture.WorldWidth = 12;
TEnvironment.WorldHeight = 8;
TEnvironment.WorldWidth = 12;
}
}
}