#### Archived

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

# A challenge

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

## 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 on other sites
Ooops, the spaces didn''t show. Try
http://www-student.cs.york.ac.uk/~tg116/ch1.txt

Tim

##### Share on other sites
>... 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

1. 1
Rutin
68
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 21
• 10
• 33
• ### Forum Statistics

• Total Topics
633438
• Total Posts
3011880
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

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!