Mesh getVertices gives wrong results

There’s something up about


PG here

It’s not working correctly even on meshes that don’t have skeletons

This PG samples the vertices data and creates spheres at those vertex positions. And turns out it’s flipped

Might be related to this bug

You have to apply the same transformations to the spheres as to the cat itself. The easiest way is to parent them to the cat mesh

or you can bake the transformations into the vertices:



1 Like

bakeCurrentTransformIntoVertices is what I’m looking for, thank you!

I do think this should be in the API though
A lot of devs will not know this

@roland are there any side effects to bakeCurrentTransformIntoVertices?
Can I use (abuse) it every time I want to get the vertex data? Planning to do this for skinning

Sure you can use it. If you use Blender, it’s similar to it’s Apply Transformations function.

1 Like


:stuck_out_tongue: :vulcan_salute:

yea, I’m not a jedi master yet :rofl:

That’s why you must train :smiley: Me too.

Basically it’s a good idea to go through the whole docs even if not in details just be aware what the framework offers so you can look up the details when needed. I’ve read the whole stuff mutiple times and I am still missing some pieces. The toilet is a good place to read, I can really recommend it :smiley: And you know, we all make mistakes so no worries.

Keep coding dude!


Just for fun:

My son is 18 years old and he is also a programmer and when he makes a mistake just because he didn’t check the docs I everytime send him this :smiley: :smiley: :smiley: have it on my desktop prepared :smiley:

True but that’s why more docs need to be there!
Like, what’s missing in the tutorials is a warning that this bakeCurrentTransforms is almost always necessary!!

I’m sorry, but that’s not true. You get the vertices data always as raw data from the vertex buffer without any transformation. It’s a common 3D stuff.: (Updating Vertices | Babylon.js Documentation)

EDIT: And you can apply transformations to them, it’s absolutely the programmers responsibility how he/she will handle the data coming from the vertex buffer

It should still be there as a warning, most devs will not know the internals
For example, the link you showed has zero indication of the bakeCurrentTransforms
The fact that I posted this as a bug/request, means others will probably too as well

Some people can admit their mistakes, some not. Have a nice day!

lol what’s this got to do with mistakes :rofl:
It’s a legit question + a useful suggestion for tutorials. Dismissing this suggestion entirely would be committing an actual “mistake” imo
anyway nice day to you too, thanks for showing the function :muscle:

1 Like