Version 0.12.0

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Irme
Posts: 55
Joined: Sat Jul 16, 2005 8:24 am

Version 0.12.0

Post by Irme »

Thanks so much Niko!

i have yet to test out the new featured you added for us .Net'ers but i can't wait till i get off work to go home and try!

Great Job Once Again Niko!!
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Do you plan on adding overloads to the Irrlicht methods for .NET objects?

Examples:
Irrlicht.Video.Color vs System.Drawing.Color
Irrlicht.Core.Position2D vs System.Drawing.PointF
Irrlicht.Core.Rect vs System.Drawing.Rectangle
etc.

I created a class with static methods (named “IrrichtHelper”) that perform these translations. Although, I only have a few so far (the above 3 are the most common, with a few different overloads themselves, along with a few for Vector3Ds.

I use the .NET native objects in my code (and other libraries). So I just translate to Irrlicht objects whenever I need to pass something to the graphics engine.

It is not a big thing and definitely not more important than porting the remaining items over to .NET, but it would probably help make your .NET library friendlier to .NET programmers who are already familiar with the existing .NET libraries.

Code: Select all

public class IrrlichtHelper
{
...
     static public Irrlicht.Video.Color Color(System.Drawing.Color color)
     {
          return new Irrlicht.Video.Color(color.A, color.R, color.G, color.B);
     }
...
}
Irme
Posts: 55
Joined: Sat Jul 16, 2005 8:24 am

Post by Irme »

Well i got a chance to work with the terain node, but i'm having problems - everything seems to be loading just fine, but it never shows the terrain. here is the code to add the node:

Code: Select all

ITerrainSceneNode theTerrain = device.SceneManager.AddTerrainSceneNode("terrain-heightmap.bmp", null ,1010,new Vector3D(0,0,0),new Vector3D(100,100,100),new Color(0,255,255,255));
			theTerrain.Scale = new Vector3D(40,4.4f,40);
			theTerrain.SetMaterialFlag(Irrlicht.Video.MaterialFlag.LIGHTING,false);
			theTerrain.SetMaterialTexture(0, device.VideoDriver.GetTexture("terrain-texture.jpg"));
			theTerrain.SetMaterialTexture(1, device.VideoDriver.GetTexture("detailmap3.jpg"));
			theTerrain.SetMaterialType(Irrlicht.Video.MaterialType.DETAIL_MAP);
			theTerrain.ScaleTexture(1.0f,20.0f);
Any suggesstions?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

shurijo wrote:Do you plan on adding overloads to the Irrlicht methods for .NET objects?
Yes, already thought about it. Maybe a good idea :)

About the non visible terrain: Does it work in the example app I wrote? If yes, does Irrlicht write an error in the console of your app?
Irme
Posts: 55
Joined: Sat Jul 16, 2005 8:24 am

Post by Irme »

i figured out the problem.

instead of using:

Code: Select all

ITerrainSceneNode theTerrain = device.SceneManager.AddTerrainSceneNode("terrain-heightmap.bmp", null ,1010,new Vector3D(0,0,0),new Vector3D(100,100,100),new Color(0,255,255,255)); 
         theTerrain.Scale = new Vector3D(40,4.4f,40); 
i had do set the initial scale - apparently setting the scale afterwards will not work. here is what i used to make it work.

Code: Select all

ITerrainSceneNode theTerrain = device.SceneManager.AddTerrainSceneNode("terrain-heightmap.bmp", null ,1010,new Vector3D(0,0,0),new Vector3D(40,4.4f,40),new Color(0,255,255,255)); 
Locked