Sign in to follow this  
me_here_me

scaling

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this