hen Posted January 18, 2016 Share Posted January 18, 2016 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()); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 18, 2016 Share Posted January 18, 2016 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:) Quote Link to comment Share on other sites More sharing options...
hen Posted January 18, 2016 Author Share Posted January 18, 2016 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! Dad72 and jerome 2 Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 18, 2016 Share Posted January 18, 2016 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. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
hen Posted January 18, 2016 Author Share Posted January 18, 2016 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 RaananW 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 18, 2016 Share Posted January 18, 2016 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" jerome 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.