• Advertisement

Archived

This topic is now archived and is closed to further replies.

Transforming a ray into local space w/ scale

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a picking ray (vOrigin, vDirection) generated from a screen point in world space, and im transforming the ray into local space of the object that i want to pick (so i can perform intersection tests in local space). This all works fine until i want to scale the object. It is acting as if i''m not scaling at all (ie. after scaling the ray it picks as if the scale is just (1,1,1)). If i multiply the ray by a scaling matrix the origin gets scaled correctly (as far as i can see). The direction vector gets scaled then normaalized so the direction vector of course remains the same. What am i doing wrong here??? Any help is much appreciated .

Share this post


Link to post
Share on other sites
Advertisement
Okay, i worked it out. I had to invert the scaling matrix so i was effectively scaling DOWN the ray origin when the object was begin scaled UP.

- Thomas

Share this post


Link to post
Share on other sites

  • Advertisement