# Coord Transformation problem

This topic is 4562 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 :
{
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 ? 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) thanks a lot Killan

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633674
• Total Posts
3013277
×