Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Horizons Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Arn

August 27, 1999, 02:23 PM

Hello.

I am in need of a way to calculate where to place the horizon line based on a camera matrix and camera position. The horizon line I need is exactly like those found in good old flight sim games.

I build the camera matrix myself using a look/target/twist method. I've tried a couple methods all of which induce a jitter into the horizon line's screen position. I'm sure I'm missing something obvious here, has anyone seen a slick way of doing this?


Arn

 
Parashar Krishnamachari

August 27, 1999, 04:04 PM

Arn wrote:

>>I build the camera matrix myself using a look/target/twist method. I've tried a couple methods all of which induce a jitter into the horizon line's screen position. I'm sure I'm missing something obvious here, has anyone seen a slick way of doing this?

Well, given the "forward vector" -- which is target-location normalized -- let's say you have a fixed distance you can view out. That fixed distance is multiplied by the y-component of the forward vector. That is how much below "0" the horizon line is. If y is negative, then obviously, the horizon line is above "0." Given the roll angle, you rotate the horizon line that much about the "origin."
Obviously, for one of those little horizon indicators on a flight sim, the numbers would be significantly scaled down. It's a simple similar triangles type of thing.

- C.P.I. / ASMiNC

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.