Wrong node rotation when using addOctreeSceneNode

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Wrong node rotation when using addOctreeSceneNode

Post by mant »

I have a box with a missing face.
The right rotation is that the missing face points to the camera (like the second image in link)
But when using octree scene node it seems that the missing face points up

How can I investigate the problem further?
http://imgur.com/a/aOOMt
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Wrong node rotation when using addOctreeSceneNode

Post by CuteAlien »

You could disable culling for a test. I'd be surprised if the reason for this really has to do anything with the octree.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Wrong node rotation when using addOctreeSceneNode

Post by mant »

With setAutomaticCulling(EAC_OFF); it still affects the rotation of the node that I call addOctreeSceneNode for.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Wrong node rotation when using addOctreeSceneNode

Post by CuteAlien »

Ah sorry, I was just reading about "missing face". Wrong rotation - uhm, no clue. Do you have some short code we can compile to reproduce this?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Wrong node rotation when using addOctreeSceneNode

Post by mant »

Code and model: https://drive.google.com/open?id=0BxGL1 ... EIxRDF1Szg

You have to move the camera a little bit to detect the correct missing face of the original mesh
http://imgur.com/a/LHT1s
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Wrong node rotation when using addOctreeSceneNode

Post by CuteAlien »

Normals of box.x point in the wrong direction. Normals have to go towards the outside if you want to look at the box from the outside. Alternatively you could disable backface culling (not recommended, always better to fix the model).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Wrong node rotation when using addOctreeSceneNode

Post by mant »

Yeah I flipped the normals since I wanted to look from the inside, like a room. Still wondering why the octree rotated my node though ...
It indeed rotates my node around x axis 90 degrees, on every octree node I create, even with the small cube with correct normals.
Have any chances that something's off with .x format specially?
Right now I have to check if a node is octree and subtract it's rotation, like rot.x-90
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Wrong node rotation when using addOctreeSceneNode

Post by CuteAlien »

Hm, didn't notice that, guess I'd have to check again. Did you compare octree to using node with just meshnode?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Wrong node rotation when using addOctreeSceneNode

Post by mant »

My scene has multiple nodes, only the octree ones are rotated somehow. Other nodes with different type are OK.
But really, if this has problem, someone must have reported before,... I'm doubting my meshes now, will check the Blender export plugin.
Post Reply