Sign in to follow this  
lucky6969b

Failed to attach objects

Recommended Posts

[code]
if (m_pCombineFrameMatrix != NULL) {
// Get Object Space of attached object
D3DXMatrixInverse(&mat2, NULL, m_pCombineFrameMatrix);

D3DXMATRIX mat3;

// Transform it to world
D3DXMatrixMultiply(&mat3, &mat2, &m_matWorld);
m_matWorld = mat3;
}

[/code]

The output is a bit wield. It is huge and gone to mysterious places.
Any ideas that could help me out with this?
Thanks
Jack

Share this post


Link to post
Share on other sites
[url="http://imageshack.us/photo/my-images/406/problem2o.png/"]http://imageshack.us.../problem2o.png/[/url]
Problem is the pallet and the fork are not aligned. I have used the fork->pframefirstchild = pallet_frame; equating fork->matCombined = palllet->matCombined; Still off by a little bit. Is it the artwork problem? Thanks Jack

Share this post


Link to post
Share on other sites
Shall I assume you are asking about parenting an object under another object?
The forklift should be the parent of the crate?

Each object should have two types of transforms: local and world. When you update the transform on any given object, you are always updating its local.
At the end of each frame, world transforms need to be generated by having each object send its world transform down to its children.
Children create their world transforms by multiplying first by their own local transforms, then by the world transform given to them by their parents.

If you want to check if this is an art problem, set the transform of the crate to a specific place and see if it actually is at that place as you expect. Or open the source file for the art in Maya or 3D Studio Max (or whatever).


L. Spiro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this