New to Irrlicht
New to Irrlicht
Hi everyone, I am new to Irrlicht and I'd like to say I really love it so far. I have just a few questions I was hoping to see answered.
1) I see how to draw a 2D line on the screen, but how do I draw a 2D circle? I need to draw a circle around one of my objects.
2) I need to know what object is under my cursor - I've played with this, but seem to keep selecting my camera node or the skybox node??
3) How do I skin/change the look of the UI elements?
4) How do I know when a UI element has focus or is being dragged, a window element for example?
I humbly request any and all help.
Thank you
1) I see how to draw a 2D line on the screen, but how do I draw a 2D circle? I need to draw a circle around one of my objects.
2) I need to know what object is under my cursor - I've played with this, but seem to keep selecting my camera node or the skybox node??
3) How do I skin/change the look of the UI elements?
4) How do I know when a UI element has focus or is being dragged, a window element for example?
I humbly request any and all help.
Thank you
For #2, I use the id field when creating an object and the idBitMask field when calling any of the GetSceneNodeFrom functions.
eg:This makes it so I will only get 'other char' objects.
eg:
Code: Select all
public enum ObjId
{
Map = 1,
Camera = 2,
OurChar = 4,
OtherChar = 8,
Light = 16,
}
Code: Select all
mNode = Global.Scene.AddAnimatedMeshSceneNode(mesh, null, (int)(IsPlayer ? ObjId.OurChar : ObjId.OtherChar ));
Code: Select all
selectednode = Global.Scene.SceneCollisionManager.GetSceneNodeFromScreenCoordinatesBB(Global.Device.CursorControl.Position, (int)ObjId.OtherChar);
Thanks, I see now what I was doing wrong on object selection - however, for some reason I'm not able to get back my mesh object, only my billboard object:
Any idea what I am doing wrong there?
Thanks again!
Code: Select all
device.SceneManager.AddBillboardSceneNode(null, new Dimension2Df(10,10), new Vector3D(0,0,0), 2);
device.SceneManager.AddAnimatedMeshSceneNode(planetMesh, null, 4);
Code: Select all
node = device.SceneManager.SceneCollisionManager.GetSceneNodeFromScreenCoordinatesBB(mouse, 2|4);
Thanks again!
Right, as you can see I have a sun and a planet. The sun is a billboard (two actually spinning on top of each other in opposite directions to give it a sparkling effect)
This code returns the sun when the mouse is over the sun (as expected), however node == null when I am over the planet.
Thanks for the complement on the concept! Now if I can just make it real, that's the big trick! I think I can do it with Irrlicht from what I've seen, it will just take time. I don’t know c++, so I am working with the Irrlich.NET.dll using C#. I can read c++, but I don’t know the syntax so I couldn’t write it.
I really appreciate all the help you are giving me, thanks!
Code: Select all
node = device.SceneManager.SceneCollisionManager.GetSceneNodeFromScreenCoordinatesBB(mouse, 2|4);

Thanks for the complement on the concept! Now if I can just make it real, that's the big trick! I think I can do it with Irrlicht from what I've seen, it will just take time. I don’t know c++, so I am working with the Irrlich.NET.dll using C#. I can read c++, but I don’t know the syntax so I couldn’t write it.
I really appreciate all the help you are giving me, thanks!
Ok, so I thought: "Maybe it’s my actual mesh giving me problems?" I'm using earth.x from the media directory. I changed it to dwarf.x and <BOOM> it started working!
I do wonder though what is wrong with earth.x that prevented it from being detected.
Well, I wasn’t planning on using the example media files as my project grows so that isn’t a big issue. Now to other things in my attempt to build my concept screen.
Thanks for you help, I'll be sure to post again when I get stumped!

I do wonder though what is wrong with earth.x that prevented it from being detected.

Well, I wasn’t planning on using the example media files as my project grows so that isn’t a big issue. Now to other things in my attempt to build my concept screen.
Thanks for you help, I'll be sure to post again when I get stumped!
-
- Posts: 448
- Joined: Tue Oct 05, 2004 3:24 am
- Location: Boston, MA
That looks nice much like Homeworld, Keep up he work and you will have my support! 

Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
Learn the basics at </dream.in.code>
Thanks Skater, I'm working on the interface now and I'm not sure what’s the best way to do it. I tried using Draw2DImage to put my interface buttons at the bottom of the screen, but it isn’t drawing my image correctly - it somehow degrades the quality. But I'm not sure if this is the best approach in the first place as I don’t know how to detect if my mouse is over a particular button etc.
Can anyone give me some suggestions as to how they would reproduce my concept screen and interface?
Thanks!
Can anyone give me some suggestions as to how they would reproduce my concept screen and interface?
Thanks!
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1
Lookin' pretty sharp there Magikos (the concept work), I'm jealous 
To help you with some of your questions:
#1 you could plot really small lines and make a circle, although that would be slow.... I'd like to do this myself, I want to rewrite the line drawing code to be faster and allow for curved lines (ellipses, circles) I just use draw2Dline for now
#3 there's a GUIEnvironment call to set the gui skin parameters, and I believe the mesh viewer tutorial shows how this can be done.
#4 as far as I know, there is no way to tell if a window is being dragged, I needed to save window positions when my editting app exited, so what I did is whenever a window receives a focus lost event (or element left event, can't remember) it checks it's current position and updates it internally so that when the app closes it can save this information.

To help you with some of your questions:
#1 you could plot really small lines and make a circle, although that would be slow.... I'd like to do this myself, I want to rewrite the line drawing code to be faster and allow for curved lines (ellipses, circles) I just use draw2Dline for now
#3 there's a GUIEnvironment call to set the gui skin parameters, and I believe the mesh viewer tutorial shows how this can be done.
#4 as far as I know, there is no way to tell if a window is being dragged, I needed to save window positions when my editting app exited, so what I did is whenever a window receives a focus lost event (or element left event, can't remember) it checks it's current position and updates it internally so that when the app closes it can save this information.