Hi all,
I have run into a problem and dont know how to solve it. Hope you can help me
Concretely speaking Im trying to position carton boxes on a pallet. This pallet has a parent, which is an empty scenenode with a 3D position. The boxes' their parent is the pallet. This way i only have to make sure i have to position the pallet correctly, the boxes will move along with the parent.
When im positioning the boxes, they do not appear 'on' the pallet but next to it. Im 90% sure i calculated the relative positions on the boxes correct, so my question to you is: Am i doing this parenting correct or am i doing something wrong?
relative positioning to parent
How could we tell if you do anything wrong or correct if you don't show the source in question? :-)
The only general information we can give is that Y is by default the vector value for height (unless you did some rotations).
The only general information we can give is that Y is by default the vector value for height (unless you did some rotations).
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Basically this is the situation
Like i said im 90% sure my positioning code is correct. Am i correct by thinking the box will move along with the pallet when i do my parenting as described above?
For example: The pallet's Y coordinate is -37 relative to its parent. This is correct, i see the pallet on the floor. The box' position should be positive to its parent, since its placed on the pallet. However, debugging tells me it's -27. How does this happen? Im not sure, but it looks like the position is calculated relative to its parent's parent.
Code: Select all
Pallet->setParent(an Empty SceneNode)
Box->setParent(Pallet)
For example: The pallet's Y coordinate is -37 relative to its parent. This is correct, i see the pallet on the floor. The box' position should be positive to its parent, since its placed on the pallet. However, debugging tells me it's -27. How does this happen? Im not sure, but it looks like the position is calculated relative to its parent's parent.
So you are saying your box relative coordinates switch from positive to negative without you changing them in any way? That would be a bad bug - but I use empy scene nodes a lot and so far it's not a bug I've seen.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Mystery solved :-)
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm