draw3DBox

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

draw3DBox

Post by Mr_Ridd »

Hey

For some reason I just can't get this to work. I've looked at other code but the 3D box just won't draw.

I don't have code here but is there something special you have to do to get it to draw. Say I import a model. If I get the bounding box of it by

node->getBoundingBox()

and then I pass that aabbox<float> box into the add3DBox() function, it doesn't draw.

I also set the transform and the material, but it's still doesn't draw.

Thanks
POi

Post by POi »

A thought ...

Are you drawing the box after manager->drawAll() ... if not all the other objects will draw on top of it?!
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

No, I'm not.

I even took all other objects out of the scene and it still didn't draw. I changed the colors as well.
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

BoundingBoxes aren't visible boxes. They are just data that defines the points of the area of the object.

You can turn them on to a visual representation using bool irr::scene::ISceneNode::DebugDataVisible

If you just want a box, use SceneManager::addTestSceneNode()
Crud, how do I do this again?
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

What I actually want to do is draw a wireframe box around a light. There was a thread about this. You can't use setDebugDataVisible() on a light. I tried what they said and it didn't work.

But even so, why won't it draw any box?
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

saigumi wrote:BoundingBoxes aren't visible boxes. They are just data that defines the points of the area of the object.
I think he's on about getting the dimensions of the bounding box and passing them to the driver->draw3DBox() function.

So it isn't working eh? Hmm. Firstly, does the function work at all? Can you draw a box with some coords you make up?

If you do this and it draws fine then you need to printf the coords of the bounding box to the console so you can see if they are the problem. I suspect the overall function isn't working but that's the best way to figure out what is happening that I can think of.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Are you sure it's placed inside the drawing loop?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
XargoL
Posts: 22
Joined: Sun Aug 01, 2004 7:55 pm

Post by XargoL »

Hmm, maybe lights doesn't use bounding boxes at all, or it's too small to be visible...
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Mr_Ridd
Posts: 63
Joined: Tue Sep 28, 2004 5:16 am

Post by Mr_Ridd »

Hey

I tried to make my own box with co-oords and it still didn't draw. It is in the drawing loop. I think. It has to be because it's the same way I do everything else.

Don't worry though, I'm going to do something else. I need to be able to select the light, so I'm going to make a little icon, if you wish, that I can select. Then I will just set the position of the light to wherever the icon is placed. I'll also give the icon and the same sought of thing flags to tell my game engine that it mustn't draw them.
Post Reply