using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Drawing3d;
using Drawing3d.Math;
using Drawing3d.Devices;
namespace HelloWorld
{
public partial class Form1 : Form
{
Texture TPicture= new Texture();
Texture TEnvironment = new Texture();
public OpenGlDevice Device = new OpenGlDevice();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Set the current form as control of the device
Device.WinControl = this;
// Adds a paintingmethod to drawing into the form
Device.OnPaint += new EventHandler(Device_OnPaint);
Device.Navigate = NavigateKind.ZoomRotateTrans;
Device.BackColor = Color.White;
TPicture.LoadFromFile("Fishes.jpg");
TEnvironment.LoadFromFile("reflection.jpg");
TPicture.WorldHeight = 8;
TPicture.WorldWidth = 12;
TEnvironment.WorldHeight = 8;
TEnvironment.WorldWidth = 12;
}
void Device_OnPaint(object sender, EventArgs e)
{
// Hintergrund undurchsichtig
Device.Translucent = 1;
Device.Emisson = Color.White; // macht die Sache heller
Device.texture = TPicture;
Device.PolygonMode = PolygonMode.Fill;
Tools.drawBoxAt(Device,new xyz(-6,-4,0), new xyz(12, 8, 0));
// Hintergrund halbdurchsichtig
Device.Translucent = 0.4;
Device.Emisson = Color.DarkGreen;
Device.texture = TEnvironment;
Tools.drawBoxAt(Device, new xyz(-6, -4, 0), new xyz(12, 8, 0.5));
//
}
}
}