Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!UCBVAX.BERKELEY.EDU!"Dan Karron From: Dan Karron@UCBVAX.BERKELEY.EDU Newsgroups: comp.sys.sgi Subject: Have a better lookat() ? Message-ID: <9103232036.AA05543@karron.med.nyu.edu> Date: 23 Mar 91 20:36:44 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: karron@cmcl2.nyu.edu Organization: The Internet Lines: 19 Has anyone have an algoritm for removing the annoying twist when you use lookat() to view an object from arbitrary locations ? I need the formulas given two points that define an eye vector will return the euler angles (Z,Y,X is my preferred order) that will (when inverted) give a view of an object with the world space +Z vector always pointing up (+y in screen space) as much as possible. I am hard coding values for the 24 cardinal points of a cube surrounding an object for eye positions looking at the origin, and there must be a formula to calculate the roll (Z euler angle) to keep the object right side up. Cheers! (I will post the values that look good, but what is the formula for arbitrary locations ?) | karron@nyu.edu (e-mail alias ) Dan Karron, Research Associate | | Phone: 212 263 5210 Fax: 212 263 7190 New York University Medical Center | | 560 First Avenue Digital Pager <1> (212) 397 9330 | | New York, New York 10016 <2> 10896 <3> |