Jump to content
  • Advertisement
Sign in to follow this  
me_here_me

scaling

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

I have two datasets displayed on separate screens. dataset1 has z values in the range 0 to 60. dataset2 has values from range -15 to 15. I have to apply uniform scaling on dataset2 so that it is equal to dataset1. But when I apply a scaling of 2 to the dataset2, it looks slightly bigger than dataset1 on the screen. The reason, as I understand is that, as I am using perspective projection and the place from where dataset1 starts and dataset2 starts is different (0 and -15), therefore I see one dataset slightly bigger than the other. unfortunately I cannot translate the dataset :( is there some method to control the fov or any parameter of perspective projection, so that I see the same size. thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
thanks for answering

orthographic is not an option. have to use perspective :(

some kinda mathematical hint will be helpful

thanks

Share this post


Link to post
Share on other sites
Change the scale factor of one of the data sets..


Suppose you have a vertical fov - fovy; and a screen aspect - A.

Then try dividing the closest data set (or multiplying the furthest set) by:

tan(fovy*A)

(This is AFTER you do your initial scale (factor 2 in this case)).


(As always, be sure that your trig functions accept the same angle unit as that of your fovy).

[Edited by - wentworth on August 15, 2007 6:52:32 AM]

Share this post


Link to post
Share on other sites
thanks for the help

just a query.

u said "Then try dividing the closest data set by tan(fovy*A)"

do u mean that I should divide each vertex of my dataset with this value?

warm regards

Share this post


Link to post
Share on other sites
Quote:
Original post by me_here_me
do u mean that I should divide each vertex of my dataset with this value?


If that's how you "applied a scaling of 2", then yes.

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.

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!