Jump to content

How to get the three vector coordinate of a vector3 separately ?


elkyu
 Share

Recommended Posts

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.  :)

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...