Hi all,
I try switch LightNode->setDebugDataVisible(true),
but cannot see Debug box. Someone knows how?
Thanks in advance.
LightNode->setDebugDataVisible
Well debugDataVisible(the AABB rendering) is only applied to the following sceneNodes :
CAnimatedMeshSceneNode,
CMeshSceneNode,
COctTreeSceneNode,
CParticleSystemSceneNode
in the CLightSceneNode the method is simply inherited from irr::scene::ISceneNode but setting debugDataVisible to true doesn't affect the rendering , well i guess Niko ommited this part since a light source isn't
actually a mesh or ParticleSysyem and it could be represented by a single vector for the position and other parameters depending of the light type cone direction ,fall off etc so in theory talking about a light's AABB is kinda unnatural IMHO , but in practice you see that sometimes you need to see a box around a light in order to get the idea of where it is actually in space , but as you can see you loose the information about the direction , range etc. A better representation would be a 3D arrow or something and a bounding sphere.
Anyway i appreciate your Irrlicht->Borland port(yeah i'm a Borland bitch:)) and i wanna return the favour as much as i can
Here is what i came up with so far :
in the void CLightSceneNode::render() [file CLightSceneNode.cpp (line 41)]
in the end of the function put this :
Push compile button, Enjoy
CAnimatedMeshSceneNode,
CMeshSceneNode,
COctTreeSceneNode,
CParticleSystemSceneNode
in the CLightSceneNode the method is simply inherited from irr::scene::ISceneNode but setting debugDataVisible to true doesn't affect the rendering , well i guess Niko ommited this part since a light source isn't
actually a mesh or ParticleSysyem and it could be represented by a single vector for the position and other parameters depending of the light type cone direction ,fall off etc so in theory talking about a light's AABB is kinda unnatural IMHO , but in practice you see that sometimes you need to see a box around a light in order to get the idea of where it is actually in space , but as you can see you loose the information about the direction , range etc. A better representation would be a 3D arrow or something and a bounding sphere.
Anyway i appreciate your Irrlicht->Borland port(yeah i'm a Borland bitch:)) and i wanna return the favour as much as i can
Here is what i came up with so far :
in the void CLightSceneNode::render() [file CLightSceneNode.cpp (line 41)]
in the end of the function put this :
Code: Select all
// for debug purposes only:
if (DebugDataVisible)
{
core::matrix4 mat ;
mat.makeIdentity();
mat.setTranslation(LightData.Position);
driver->setTransform(video::ETS_WORLD, mat);
BBox.reset(core::vector3df(0,0,0));
BBox.MaxEdge = core::vector3df(20,20,20);
BBox.MinEdge = core::vector3df(-20,-20,-20) ;
video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
driver->draw3DBox(BBox, video::SColor0,255,255,255));
}
Push compile button, Enjoy
OK, that works!
Only
driver->draw3DBox(BBox,video::SColor (0,255,255,255));
must be instead
driver->draw3DBox(BBox, video::SColor0,255,255,255));
Sticky keyboard keys?
I still don't know whether in v.07 are directional lights included.
But after some experiments have tried this
For sphere light:
Irrlicht have not any octahedron /sphere/ drawing functions, but it's possible to make it. At this time I'm so lazy for implementation of similar drawing functions , but it's not so hard. Well, time will show - I hope some other user to make it instead me
Only
driver->draw3DBox(BBox,video::SColor (0,255,255,255));
must be instead
driver->draw3DBox(BBox, video::SColor0,255,255,255));
Sticky keyboard keys?
I still don't know whether in v.07 are directional lights included.
But after some experiments have tried this
For sphere light:
Code: Select all
//internal 3dbox for orientation of position /white/.
BBox.MaxEdge = core::vector3df(20,20,20);
BBox.MinEdge = core::vector3df(-20,-20,-20) ;
//additional external 3dbox for approximately range orientation /with color of this light/
float r = LightData.Radius;
BBox.MaxEdge = core::vector3df(r,r,r);
BBox.MinEdge = core::vector3df(-r,-r,-r) ;
Well i'll try to add the following scene nodes to DX part of Irrlicht :Irrlicht have not any octahedron /sphere/ drawing functions, but it's possible to make it. At this time I'm so lazy for implementation of similar drawing functions , but it's not so hard. Well, time will show - I hope some other user to make it instead me
Paralelepiped(Box)
Cylinder
n-sided polygon
Sphere
Teapot
3D text
Torus