Jump to content
  • Advertisement
Sign in to follow this  
kc_0045

2d position on a 3d plane, from a 3d position.

This topic is 3801 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

First off, I have no idea if that subject title made any sense. Pretty much what I need to do is, Well look at these pictures (Made in secondlife, Woo haha) http://img524.imageshack.us/my.php?image=snapshot001vv2.png http://img523.imageshack.us/my.php?image=snapshot002hk5.png What I need to do, is the get "Local" offset of Object 2(Blue box) from object 1(Red box) By local offset, I mean the Green cylinder length would be the X value, and the Blue the Y value, But without using Cylinders of course. In this case the Red cylinder is going in the direction of objects 1 local Y axis. I would also need to be able to change this for each 6 sides(Well, 3 sides I guess I would just have to flip the x for the opposite. Any ideas on how to go about this? What I was thinking would be First you need to "Cancel out" objects 2s rotation, Aka if it was on the position seen in snapshot2, change it so it would be like in snapshot 1, then simply get the offset. But I have no idea how to do this :( Something to do with a Rotation Matrix im assuming, but I have never done anything with them before :( [Edited by - kc_0045 on July 16, 2008 10:03:28 PM]

Share this post


Link to post
Share on other sites
Advertisement
Okay, After thinking it over pretty much what I need to do is get the 2d position on a 3d plane, from a 3d position, one way I was thinking of would be to use Perspective projection, where the viewer position would be the same as the plane, would that work?

I got the idea from http://en.wikipedia.org/wiki/Perspective_projection#Perspective_projection

But would there be a simpler way of doing this? :S

Share this post


Link to post
Share on other sites
you can use matrices. multiply the inverse matrix of one by the transform matrix of the other to get the other's matrix transform relative to the first. Then you can get the pos/rot... whatever from this matrix. ciao!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!