pabitel Posted March 16, 2016 Share Posted March 16, 2016 Hi, I'm new to Babylon JS. I have a model that I would like to perform some vertex animation, but I have a problem. In both Blender and Lightwave the model has 9,856 vertices, but after loading the mesh from the Blender-generated .babylon file through ImportMesh(), getTotalVertices() returns 10,400 vertices. Can anyone explain the discrepancy? Thank you. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 16, 2016 Share Posted March 16, 2016 hello and welcome! Blender and Lightwave give you the count of different coordinates. Babylon.js gives you the count of different vertices (they could have same position but different UV for instance) Wingnut 1 Quote Link to comment Share on other sites More sharing options...
mwpowellhtx Posted March 27, 2016 Share Posted March 27, 2016 More general question, when I start by inheriting from Mesh, adding some calculators for my model, etc, then I should provide a getTotalVertices(), which does what precisely? I need to sum up the vertices of the children in my mesh? Thank you... Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 27, 2016 Share Posted March 27, 2016 Oh, not only do we need to show you where the end of the rainbow is, but now you want us to haul your pot of gold, too? heh. Sounds like you need to investigate 'subMesh'. Or meshMerge. Or... just get back to using .parent like a nice young man. Find a class called 'vertexData'. It is the "assembler" for all the mesh primitives. There's TONS to be learned from that class. It does all the work for Babylon.Mesh.Createxxx(). Notice there is Babylon.Mesh, and Babylon.MeshBuilder. MeshBuilder does some nice stuff. Are you still disassembling Node class? Is your dog watching you? Does it look like it thinks you are crazy? All in all, setVerts, getVerts, normals, uvs, colors (per vertex), indices... all are built via arrays on vertexData objects. It's a nice factory. Remember to set your mesh updatable = true... if you are about to go mesh-morphing. Quote Link to comment Share on other sites More sharing options...
mwpowellhtx Posted March 27, 2016 Share Posted March 27, 2016 @Wingnut What .parent, dude? Using an instance of Mesh.CreateTube, I do not see any "parent" to speak of; the closest thing is subMeshes. Be more specific. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 27, 2016 Share Posted March 27, 2016 http://www.html5gamedevs.com/topic/18006-babylonjs-very-slow/?do=findComment&comment=102017 Maybe that will help. 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.