[Plib-users] Bug in sgHPRfromVec3?
Brought to you by:
sjbaker
From: Jon <jtw...@ih...> - 2001-11-18 12:47:38
|
I'm currently tinkering with an app using the PLIB library which I have found to be quite useful so far, however I have found on problem which I think is a bug with the library. I am using the sgHPRfromVec3 function to produce a camera orientation to view my model. It works well as long as my model and the camera are the same height above the terrain but as soon as the relative height changes the camera pitches off in the wrong direction. here is the appropriate code snippet (scan is the current position of the object, track is the camera position): sgSubVec3(temp, scan, track); sgHPRfromVec3(scan,temp); sgSetCoord (&campos, track , scan); if I add the following line between the second and third lines the camera will track correctly. scan[1] = - scan[1]; I'm not sure if this is a problem with my code or a problem with the Plib library, certainly changing the version didn't seem to affect the behaviour. I would be grateful for any light that could be shed on the matter. Jonathan Wheare. |