How set the oigin of an element or picture in the center of image

hello all

how set the oigin of an element or picture in the center of image?

in fact i want to rotate a element who have a image.png.
i want set a local rotation of the image and set the centre of rotation in the center of image.

thanks for your help

If the element is a Spatial, you can use element.setLocalRotation() to rotate it in three dimensions and setLocalTranslation() to move its center in 3 dimensions.

[java]
Geometry.center();
[/java]

Then rotate (though, I thought this was the case by default.

Geometry.center() just sets the local translation of the geometry. It will still rotate about its own origin. It would have to be the child of another node and that node rotated for it to be about the center.

@pspeed said: Geometry.center() just sets the local translation of the geometry. It will still rotate about its own origin. It would have to be the child of another node and that node rotated for it to be about the center.

Made the assumption that Node > Geom > Mesh … oops