scaling

Started by
4 comments, last by wentworth 16 years, 8 months ago
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
Advertisement
You can use an orthographic projection.
thanks for answering

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

some kinda mathematical hint will be helpful

thanks
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]
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
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.

This topic is closed to new replies.

Advertisement