elkyu Posted June 22, 2015 Share Posted June 22, 2015 Hi, I get an array with all the vertex coordinates of a plane. (P0x, P0y, P0z, P1x, P1y, P1z, …) Then, with the function Vector3.toArray(array, index) I can make a vector3 from the indicated index. For example : var array = [P0x, P0y, P0z, P1x, P1y, P1z,P2x, P2y, P2z, P3x, P3y, P3z]; var vector =BABYLON.Vector3.FromArray(array, 3); So, my vector is : {x, y , z} => {P1x, P1y, P1z); But ! I would like to do the opposite. If I have a Vector3 and I want set its values in the array which contains all vertex coordinates I have to decompose the vector into three value. How to do that ? How to get the three vector coordinate separately ? Thanks. Quote Link to comment Share on other sites More sharing options...
RaananW Posted June 22, 2015 Share Posted June 22, 2015 A vector object has two functions that can help you:asArray() returns the coordinates as a new array objecttoArray(existingArray) append the coordinates to an existing array 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.