Jump to content
  • Advertisement

Archived

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

timgradwell

A challenge

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

A challenge for all the mathematically inclined folk here. You are inside a cube. In front of you, you see one corner of the cube: --------------------------------------------- | \ | | \ A | | \ | | \ ____________| | \ _____----------------- | | | | | C | | | | | | | B | | | | ---------------------------------------------- where A is the top of the cube, and B and C are two sides of the cube. Labeling each edge of the cube with the sides of the cube it joins (eg AC is the line between the top and side C), if you are given the angles AC-AB, and AB-BC, and BC-AC (as they appear on the 2d computer screen), is it possible to extract the angle of the line that your viewpoint must be on? So for example - how do you calculate the angles in the following views: Plan view B ----------------------------- |\ | | \ | |a \ | | /\ | |_/ \ A | | \ | | \ | C| \ | | \ | | \ | | \ | | \ | ----------------------------- Front view A ----------------------------- |\ | | \ | |b \ | | /\ | |_/ \ | C| \ B | | \ | | \ | | \ | | \ | | \ | | \ | ----------------------------- side view A ----------------------------- |\ | | \ | |c \ | | /\ | |_/ \ | | \ C |B | \ | | \ | | \ | | \ | | \ | | \ | ----------------------------- How do you calculate angles a, b and c? Cheers Tim

Share this post


Link to post
Share on other sites
Advertisement
>... is it possible to extract the angle of the line that your
> viewpoint must be on?

Yes, in that there's a unique solution. You could construct a surface above A representing all observation points from where the two edges of A subtend such an angle to the observer. I think this surface is a curve, something like a hyperbola, swept out along rays away from the point the planes meet.

Do this for B and C and you have three surfaces which meet along the desired direction. But I don't see how to calcuate this directly. The best approach may be iterative: make a first guess, chack it and if it's wrong move it in such a way to improve it. E.g. if angle AB-AC looks too big moving away from A will make it smaller. Repeating this for each plane in turn, making the steps smaller and smaller, should converge to the solution with good choices of step size.

Edited by - johnb on July 18, 2001 10:12:51 AM

Edited by - johnb on July 18, 2001 10:14:12 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!