# Coord Transformation problem

This topic is 4507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, i have some trouble with transformation coord it's in shadow volume case, i have an objet in my world with position and rotation i have a light point to générate the shadow volume (it work good) i can modify the position of my objet, it's ok for shadow, i can too made Y rotation, it's ok again but i can't make X and Z rotation i do this to have light position with my object
vecLight = lightpos;
vecLight -= lo.Position;


i annulate the deplacement and the rotation (like the object is the center of the world to have light position) it's work good but X and Z not work :s other think to know, the light vector will be modified after like this :
public void MakeShadowVolume(Vector3 lightpos)
{
if (!ombreRefaire) return;

Vector3 lightVector = Vector3.Normalize( -lightpos );
ombre.BuildFromMesh(ox.OXMesh, lightVector, Matrix.Identity);

ombreRefaire = false;
}


and at the end, the vector is modified like :
public void BuildFromMesh(Mesh mesh, Vector3 lightVector, Matrix rotationTransform)
{
// transform light vertor by inverse rotation transform used for the shadow volume & the shading mesh
Vector4 tlv = Vector3.Transform( lightVector, Matrix.Invert(rotationTransform) );
lightVector = new Vector3( tlv.X, tlv.Y, tlv.Z );

...


pictures to see the problem with comments : http://tech.daaboo.net/images/060615-p-0.jpg http://tech.daaboo.net/images/060615-p-1.jpg http://tech.daaboo.net/images/060615-p-2.jpg http://tech.daaboo.net/images/060615-b-0.jpg http://tech.daaboo.net/images/060615-b-1.jpg http://tech.daaboo.net/images/060615-b-2.jpg can you help me please ? thanks a lot Killan [Edited by - killan on June 16, 2006 12:30:03 PM]

##### Share on other sites
i have make some analyse and test

if only one axis of rotation is defined : it's ok for the shadow

but if more than one are defined : shadow move anormally

maybe it's my formula that's not correcte ? (see previous post)

##### Share on other sites
solution, axes order is important too... so simply but so important... grrr

1. 1
2. 2
3. 3
4. 4
Rutin
21
5. 5

• 9
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632936
• Total Posts
3009314
• ### Who's Online (See full list)

There are no registered users currently online

×