View Full Version : Scaling plane to view all points
03-19-2008, 12:35 PM
I'd like to view all points I get, in my plane, but some of them have to big coordinates so I should scale it, but I don't know how to check if point after projection will be in plane...
Is there any method to scale plane that every point will be visible? Can you give me some advice?
03-19-2008, 02:47 PM
Here's a suggestion. You could compute the bounding box for all your points (because applying this to all the points isn't efficient). Then transform the bounding box into Viewing coordinate system.
If you're doing orthographic projection then you can easily calculate the left,right,top,bottom clipping planes by taking maximum/minimum x,y values of all the points you transformed.
If you're doing perspective projection you'll have to calculate the maximum/minimum x,y coordinates again and calculate the required viewing angle. You'll also have to calculate the minimum/maximum z values to get the near/far clipping planes correctly.
To transform into the Viewing coordinate system use
Then you'll have to write code to apply the transform to the points.
Here's a quick illustration of viewing coordinate system:
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.