Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Another 3D question...perspective?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 paulcoz   Members   -  Reputation: 230

Like
Likes
Like

Posted 10 February 2000 - 07:11 PM

I have made a wall that is 600 wide and 600 high in world coordinates and it appears a certain size on the screen in x and y (say 400x400 pixels). However, when I rotate the wall around 90 degrees so that I stand parallel to it, it goes off into the distance (right to the horizon) eg. the 600 units distance appears to be a lot greater in z (on the screen that is) than in x and y - this is causing a stretching effect when I rotate. Would somebody know what is causing this, know how to fix it? All I do for perspective is divide x and y by z, I have no field of view implemented yet (coz I don't know how!). Any help appreciated, Paulcoz. Edited by - paulcoz on 2/11/00 1:47:38 AM

Sponsor:

#2 Spellbound   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 February 2000 - 08:16 PM

The fact that the wall seems to stretch in the z direction has everything to do with field-of-view. Lower the field of view and it should not stretch as much.

FOV sets the opening angle of the frustrum, e.g. if you have FOV at 90 degrees and you stand at the corner of a room with orthogonal walls then you''ll both walls.

To compute FOV ask yourself this question: How much can be seen at one units distance? If a two unit wall at one unit distance fills up the entire screen then you have 90 degree FOV. If a four unit wall at one unit distance fills up the entire screen then what FOV do you have? (Tip: Use arctan)

#3 Moe   Crossbones+   -  Reputation: 1249

Like
Likes
Like

Posted 11 February 2000 - 03:20 AM

there is a tutuorial under the reference/programming/3d and theory that is pretty good. it is part 2 of five, i think (by chris hargrove)

hope that helps

#4 paulcoz   Members   -  Reputation: 230

Like
Likes
Like

Posted 13 February 2000 - 01:47 PM

Finally, my troubles are over...Eureka!!

Thanks guys,

I didn't have anything in my program to take into account the field of view (multiplying x and y by distance from screen or dividing z by distance from screen, so after much studying of the projection formulas and projection matrices on the weekend I found the 'missing link'.

As soon as I fixed the field of view all my other problems (stretching effect during rotations etc..) went away, and now my program works pretty well - I can walk all the way around this little cube I built

Good stuff,
Paulcoz.

Edited by - paulcoz on 2/13/00 7:55:49 PM




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS