Path: chuka.playstation.co.uk!news From: Craig Graham Newsgroups: scea.yaroze.programming.3d_graphics,scee.yaroze.programming.3d_graphics Subject: Re: Camera math Date: Wed, 03 Feb 1999 20:17:00 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 30 Message-ID: <36B8AEBC.2BB577D0@hinge.mistral.co.uk> References: <799tkt$lbf5@scea> NNTP-Posting-Host: d2-s42-136-telehouse.mistral.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Xref: chuka.playstation.co.uk scea.yaroze.programming.3d_graphics:340 scee.yaroze.programming.3d_graphics:1181 Ed Federmeyer wrote: > I have read a lot of books and online documentation describing all the 3D > matrix math to transform object-space coordinates to world-space coordinates > to screen-space coordinates, but they ALL ASSUME that the camera is at the > origin facing down the "Z" axis. > > Can anyone point me to some documentation that describes what needs to be > done to have the camera at an arbitrary location facing in an arbirtrary > direction? > > Luckily our Net Yaroze libs take care of this with the SetRView() function, > where you specify the viewpoint and refpoint, but I'd really like to > understand what goes on behind the scenes. Setup a translation to put the refpoint at the world origin, then a rotation matrix to put the camera at a point where X==Y==0 (i.e. lies on the Z axis). Now apply the inverse of that trans-rot to the whole world and carry on as the books say (you can do it the other way round by translating the camera and rotating the view point as well). > EdF Craig.