Re: [Plib-users] matrix problem with sg
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-11-17 17:28:38
|
FragFreak wrote: > i looked at the sgMakeLookAtMat4() code and it seams that the y-z > coordinates are swapped compared > to gluLookAt(). can i use the other sg-functions like the gl-functions? or > does sg use another coordinate system? SG uses a Z-is-up coordinate system...rotated 90 degrees in pitch compared to the OpenGL conventions. That's because I come from a flight simulation background where Z was always UP before OpenGL even existed because (Latitude,Longitude,Altitude) was simplistically mapped into (X,Y,Z) in early simulators. The SG model loaders all correct for that though - so existing 3D models still work no matter whether the modeller they were created on used Z-is-UP or Y-is-UP. You application code has to work with Z-is-UP - but SG makes everything entirely self-consistant by pre-multiplying the camera coordinates by a 90 degree pitch rotation matrix before rendering. In hindsight, this is perhaps unfortunate - but when I wrote SG, it didn't look like anyone else would ever use it - and my first 'customers' were the FlightGear team who are writing...A flight simulator! ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |