Is setAbsoultePosition doesnt relative to mesh pivot pointer?

Babylon.js Playground (zoom out to see the effect)

Here I make a cone
Move pivot pointer to upper corner
And set position to cone from the camera

I expect to place top corner as camera placed, but if you zoom out, you will see the middle of cone, not the top.

In the end I wanna to have cone draw from the camera to make custom frustum culling (Is it possible to set intersection ordering?)

1 Like

This is expected as the mesh is still the exact same.

In order to do what you want, you either need to bakeCurrentTransformIntoVertices() after moving the cone OR you can use a parent and offset the cone in the parent.

The pivot will be use only as a center of scale and rotation.

1 Like

Thank, seem like the solution with setup a parent works well

1 Like

Interesting. Why did it make so? All 3d soft that’s I know use pivot pointer as origin to rotate, scale, move and stick in slots.
Also, the “bakeCurrentTransformIntoVertices” didn’t work in my PG from the first message. And one point — no one example exists with this function:

Move is not related to pivot, as the pivot moves with it.

bakeCurrentTransformIntoVertices() on a mesh will basically bake the current vertices (worldSpace) into the local mesh data. So if the mesh has centered vertices, you can move it as you wish and bake the data. As a Result the mesh contains repositioned and rescaled vertices (working basically as a new parent, being baked in the data so more efficient).