Pryme8 Posted June 29, 2017 Share Posted June 29, 2017 So if I have a ground plane, and am looking to manipulate the vertex data but need the values to be updated to their correct position after a rotation and transform that I applied.http://www.babylonjs-playground.com/#DPSB16#3 Is the playground showing the creation and manipulation of the mesh. Basically what I need to happen now is when I grab the VertexData the points will have the rotation and transformation applied. I have a good idea of how to do it manually with some vector manipulation but would like to just "bake" this information then grab it instead of doing a multiple steps. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 29, 2017 Share Posted June 29, 2017 You can get inspiration from this piece of code: https://github.com/BabylonJS/Babylon.js/blob/19e68dfffc7a36243da0b72650b4bee7596664cc/src/Mesh/babylon.mesh.ts#L1333 Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 29, 2017 Author Share Posted June 29, 2017 your a boss, I am working on remapping a cube into a sphere and then working on some Dynamic LOD functions so this is needed for sure! bakeCurrentTransformIntoVertices() was the method I ended up using! bakeTransformIntoVertices requires a transform argument, if I was to pass it a custom matrix how would I construct that? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 29, 2017 Share Posted June 29, 2017 You just want to build a transform matrix with: rotation x scaling x translation Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 29, 2017 Author Share Posted June 29, 2017 I honestly have been a goober for years and have refused to learn how to construct such a matrix, could you point me to such and example? People say transform Matrix and I have always been like yeah uhhuh... http://www.babylonjs-playground.com/#DPSB16#9 Thank you by the way @Deltakosh I can now get to the LOD functions! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 29, 2017 Share Posted June 29, 2017 lol no worry: https://www.babylonjs-playground.com/#L470RV Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 29, 2017 Author Share Posted June 29, 2017 There is your playground for the TODO on the bakeTransformIntoVertices example. thanks by the way! 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.