
It's worth noting that I am using DeusXLs .NET port to do this, and that I might be missing something completely obvious...
Code: Select all
// Add the SkyBox:
SkyBox = Engine.Scene.AddSkyBoxSceneNode(
null, new Texture[] {
Engine.Driver.GetTexture("Textures/Game/irrlicht2_up.jpg"),
Engine.Driver.GetTexture("Textures/Game/irrlicht2_dn.jpg"),
Engine.Driver.GetTexture("Textures/Game/irrlicht2_lf.jpg"),
Engine.Driver.GetTexture("Textures/Game/irrlicht2_rt.jpg"),
Engine.Driver.GetTexture("Textures/Game/irrlicht2_ft.jpg"),
Engine.Driver.GetTexture("Textures/Game/irrlicht2_bk.jpg")
}, -1
);
// Add a Terrain:
Terrain = Engine.Scene.AddTerrainSceneNode(
"Textures/Terrains/Island01.bmp", null, 1, new Vector3D(0, 0, 0),
new Vector3D(0, 0, 0), new Vector3D(64, 16, 64),
Color.Gray, 5, TerrainPatchSize.TPS17
);
Terrain.SetMaterialTexture(0, Engine.Driver.GetTexture("Textures/Surfaces/GrassA1024.png"));
Terrain.ScaleTexture(10f, 20.0f);
//Terrain.SetMaterialFlag(MaterialFlag.Lighting, true);
// Position Camera:
Camera.Position = new Vector3D(Terrain.Position.X + 128, Terrain.Position.Y + 128, Terrain.Position.Z + 128);
// Add some light:
/*SkyBoxLight = Engine.Scene.AddLightSceneNode(
SkyBox, new Vector3D(Terrain.Position.X + 1280, Terrain.Position.Y + 12800, Terrain.Position.Z + 1280),
new Colorf(255, 255, 192, 128), 8, 1
);*/
// Add a freaky short man:
AnimatedMeshSceneNode Dwarf = Engine.Scene.AddAnimatedMeshSceneNode(Engine.Scene.GetMesh("Models/Dwarf.x"));
Dwarf.AnimationSpeed = 25;
Dwarf.Position = new Vector3D(Terrain.Position.X + 256, Terrain.Position.Y + 128, Terrain.Position.Z + 256);
Dwarf.SetMaterialFlag(MaterialFlag.NormalizeNormals, true);
Dwarf.AddShadowVolumeSceneNode(-1, true, 10000f);
Dwarf.Scale = new Vector3D(1.5f, 1.5f, 1.5f);
// Collision:
TerrainTriangle = Engine.Scene.CreateTerrainTriangleSelector(Terrain, 0);
Camera.AddAnimator(Engine.Scene.CreateCollisionResponseAnimator(
TerrainTriangle, Camera, new Vector3D(30, 50, 30),
new Vector3D(0, -1, 0), new Vector3D(0, 50, 0), 0.0001f
));
Dwarf.AddAnimator(Engine.Scene.CreateCollisionResponseAnimator(
TerrainTriangle, Dwarf, new Vector3D(30, 0.01f, 30),
new Vector3D(0, -1, 0), new Vector3D(0, 30, 0), 0.0001f
));
Try boiling it down to a simple testcase. 50 lines or so total should be enough to show the entire test program. Chances are likely that you are doing something wrong.provide us some code for a simple testcase