Position by corner?

JayMcBee

16-01-2013 16:32:36

Hi there,

Just started to use OgreProcedural for a simple 3D editor where users can assemble things from primitives, mostly parametrically.
Is there a way to specify the position of the meshes created by the various generators by their corner instead of their center point?
That would really help a lot building objects from OgreProcedural 'primitives'!

Cheers,
Jay

mikachu

16-01-2013 22:41:22

By corner, I assume you mean one of the corners of a generated mesh's bounding box?
So you would just need to know the bounding box to set the position accordingly.
At the moment, the bounding box is computed by ManualObject when the mesh is generated (I'll get rid of that some day), so you can get it before the generator is executed.

Thus, the easiest solution would be getting bounding box coordinates from the mesh, and setting the sceneNode position from that.

Transporter

17-01-2013 09:27:46

If you know the size of your created primitive, you can calculate the offset form the center point to a corner of your choice.

JayMcBee

20-01-2013 12:57:32

Thanks for the replies.

If you know the size of your created primitive, you can calculate the offset form the center point to a corner of your choice.

Silly me!
:oops:

Thanks, that's what I'm doing now & working just fine..

Cheers,
Jay