hen Posted January 6, 2016 Share Posted January 6, 2016 Im wondering if its possible to extrude a box mesh by face.Like to create a dynamic cube wich could be extruded in to all 6 directions at runtime? Quote Link to comment Share on other sites More sharing options...
jerome Posted January 6, 2016 Share Posted January 6, 2016 I don't really get what you mean ... Quote Link to comment Share on other sites More sharing options...
Stvsynrj Posted January 6, 2016 Share Posted January 6, 2016 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. Quote Link to comment Share on other sites More sharing options...
hen Posted January 6, 2016 Author Share Posted January 6, 2016 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. Quote Link to comment Share on other sites More sharing options...
jerome Posted January 6, 2016 Share Posted January 6, 2016 something you could do maybe with updateMeshPositions() : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#other-shapes-updatemeshpositionshttp://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 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.