# How to get world rotation of vertices?

## Recommended Posts

How could i get the rotation from vertices?
Im using the snipped below for the position.. but how to grab the rotation?

` node.position = BABYLON.Vector3.TransformCoordinates(vert, viewNode.getWorldMatrix());`

##### Share on other sites

hello actually you code applies a complete worldmatrix to your vertex including position,rotation and scaling.

You should first decompose the matrix with Matrix.decompose to get a position, quaternion and scaling vector:)

##### Share on other sites

1 hour ago, Deltakosh said:

hello actually you code applies a complete worldmatrix to your vertex including position,rotation and scaling.

You should first decompose the matrix with Matrix.decompose to get a position, quaternion and scaling vector:)

Thanks!  Now i can edit vertices via drag and drop as seen on the picture.

Babylon is surprising fast generating the mesh!

##### Share on other sites

6 hours ago, hen said:

Babylon is surprising fast generating the mesh!

correction - Babylon is surprising fast generating the mesh!

So, your first question was rather simple. The second one is much harder. reminded me of this - https://xkcd.com/1425/

In general you will have to track your mouse movement, very similar to the drag and drop demo on the playground. Afterwards you will have to change the scale/rotation/position according to the new values from the mouse movement. This cannot be done in one time - i don't know of a way to rotate, scale and reposition in one mouse movement.

##### Share on other sites

Oh.. Sorry, the second one wasnt a question, i just wanted to show a screenshot of our vertex editing tool i just finished.

As well i was trying to tell that babylon is super fast in re-generating the mesh on position changes.

This works amazing good at runtime

##### Share on other sites

3 hours ago, hen said:

Oh.. Sorry, the second one wasnt a question, i just wanted to show a screenshot of our vertex editing tool i just finished.

My bad! Reminder to self - "now" !== "how"

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.