[Papervision3D] When is a do3d 'ready'?
kruass at gmail.com
Wed Mar 4 05:31:24 PST 2009
The world attribute is set and updated during render, in the
I would suggest calculating the world value for your starting position
as you're creating and chaining the joints, once the transforms are
all ready. Or you can make a simple recursive function to do it.
The world coordinates are simply: this.world.calculateMultiply(
parent.world, this.transform );
On Wed, Mar 4, 2009 at 1:48 AM, FounderEffect <rhaedes at gmail.com> wrote:
> Many thanks for that clear explanation and perfect solution!!
> do3d.updateTransform solves the problem.
> That said, I notice that I still can't immediately 'read-off' the world
> transformation of my updated do3ds, which I do because I need that initial
> world transformation for skinning purposes, with a weighted mesh.
> In other words - I currently do the following in this order:
> -Create bones and do3d joints
> -'rig' the model by childing the joints in a branching chain
> -Establish x, y, z for the joints
> -updateTransform the joints
> -transform.copy3x3 on the joints
> And that works very well. But on the end of that sequence I'd like to
> immediately add
> so I can store a 'snapshot' of the matrix that corresponds to the starting
> position of the joint. Although the model appears on the screen as it
> should, the .world transform is not accurate, it seems, until a moment
> I recognise that I can recreate that information from the position and
> rotation information I've just fed each joint, but taking a snapshot in this
> fashion seemed convenient, since I'm reading in the position data and a
> quaternion separately from a given file format.
> In any case, many thanks for all your help!
> Steve D-7 wrote:
>> do3d objects should be ready for transform immediately after they're
>> If they're not, try executing the do3d.updateTransform() method
>> immediately after creating it.
>> The DisplayObject3D constructor sets the rotationX/Y/Z and scaleX/Y/Z
>> attributes. The setter methods for those attributes cause the
>> _transformDirty variable to be true, which causes the
>> updateTransform() method to run during the next render. The
>> updateTransform() method plays around with the transform of the do3d.
>> I'm guessing this is the behavior that you're experiencing.
>> On Tue, Mar 3, 2009 at 9:54 AM, FounderEffect <rhaedes at gmail.com> wrote:
>>> Apologies if this has been dealt with elsewhere....
>>> I've created a long chain of 'bones' (elongated cubes) which are attached
>>> articulated 'joints' (do3d).
>>> My problem is that I need to set up this chain and place it in a default
>>> configuration before anything else happens. I've found that immediately
>>> after creating the cubes and joints, I can assign x, y and z positions to
>>> them, but I can't update their transform matrix until after a 'moment'.
>>> At the moment I have a button that the user clicks to 'get started',
>>> does a lot of myObject[i].transform.copy3x3(someMatrix[j]) stuff and
>>> establishes the default rotations. But is there something I can listen
>>> to know when my bones and joints are 'ready'?
>>> Many thanks for reading,
>>> View this message in context:
>>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>> Papervision3D mailing list
>> Papervision3D at osflash.org
> View this message in context: http://www.nabble.com/When-is-a-do3d-%27ready%27--tp22314090p22326737.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
> Papervision3D mailing list
> Papervision3D at osflash.org
More information about the Papervision3D