Jump to content

Extrude Box Mesh by Face


hen
 Share

Recommended Posts

Sound like he want to scale the cube but by faces, not the entire axis like the scale function do.

it would be more like box.rightFace.scale = 2.0;

 

of course meaning you have : topFace, bottomFace, leftFace, rightFace, nearFace and farFace.

 

 

Yes, thats basicly what i want to do...

 

Im thinking about to do this by moving the face vertices in to the extrude direction but im actually struggling to select vertices connected to the boarders of a picked face.

Link to comment
Share on other sites

something you could do maybe with updateMeshPositions() : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#other-shapes-updatemeshpositions

http://doc.babylonjs.com/classes/2.2/Mesh#updatemeshpositions-positionfunction-computenormals-rarr-void

 

http://www.babylonjs-playground.com/#1UZIZC#6

 

Just keep in mind that each box face is 4 successives vertices (so 12 position elements) in the positions array

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