Question

To better explain what I'm trying to achieve, here's a simple example:

  • Scenario 1: Within some 3D container object, I would like to add two Cubes: one without any transformation, and one with small position, rotation and scale adjustments. After adding those two cubes, I would like to also transform the container's position, rotation and scale.

  • Scenario 2: In a 3D character's body, it consists of many hierarchical children (and subchildren), each having various transformations over the course of an animation.

So my question is:

How do I calculate these individual 3D object transformations efficiently? Can it even be possible to do this with only one VertexBuffer3D? Or do I need several VertexBuffer3D to keep track of each objects? Using multiple VertexBuffer3D seems like it could hit a limit (but I haven't read enough of the Stage3D / Context3D documentation to know for sure).

Was it helpful?

Solution

You should pass those transformations in as vertex program constants as matrices. Constants are quick to change. Vertex buffers are for source data and should rarely change. For advanced things like bone (i think bone animation or skeletal animation is the wikipedia term :)) models for characters, you pass multiple matrices and select weights.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top