How to get the current deformed vertex positions in Mobu?

Source: Internet
Author: User

This was a question from partner. Currently, as you know, you can fetched the static geometric data from a Fbmodel using the following ways:

Get Vertex:

Model. Geometry.getpositionsarray ();

Get indices:

Model. Geometry.polygonvertexarrayget ()

But when the model was deformed (skinning, blendshape, Pointcache), Getpositionsarray () always returns the same static coord Inates, regardless of the current animation position. How to get the deformed vertex positions?

Actually, Mobu has made lots of low level change regarding the internal geometry data structure to utilize the modern POW Erful GPU capability since Mobu 2011. And these changes did improve the deformation (skinning & Blendshape) and display performance of the dense geometry a Lot on the CUDA-enabled cards according to our internal initial benchmark. And you'll be able to get the vertex/normal position before/after deformation (skinning, Blendshape, Pointcache) via ORS DK for the internal geometry, while the deformation could still happen in GPU side

Note that since Mobu, we does convert all kinds of original geometry format (Fbmesh, Fbnurb, Fbpatch, access via Fbmode L::geometry) into a tessellated triangle mesh. and further according the material/texture/uvset/normal and etc layer elements mapping combination, control point is split Ted sometimes to preserve visual fidelity. At last this tessellatedmesh was converted to an OpenGL Vertex/index buffer object friendly format (fbmodelvertexdata, ACCE SS via Fbmodel::modelvertexdata).

MB perform deformation (GPU or CPU) & rendering only in this final modelvertexdata.

So back to the question itself, if you want to get the deformed vertex positions, you can try the following methods of FBM Odelvertexdata class:

int * Getindexarray ();

void * Getvertexarray (Fbgeometryarrayid Parrayid, bool pafterdeform=true);

unsigned int getvertexarrayvboid (Fbgeometryarrayid Parrayid, bool pafterdeform=true);

void * Getvertexarrayvbooffset (Fbgeometryarrayid Parrayid, bool pafterdeform=true);

But before using them, being sure to use vertexarraymappingrequest ()/vertexarraymappingrelease () to toggle Cpu/gpu Skinning per model when necessary.

How to get the current deformed vertex positions in Mobu?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.