Path: chuka.playstation.co.uk!news From: rs108@mdx.ac.uk (Robert Swan) Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: "center" Date: Mon, 29 Jun 1998 23:22:38 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 43 Message-ID: <35981f6f.2562571@www.netyaroze-europe.com> References: <35911bf4.80589781@news.scea.sony.com> <6n90bb$51f1@scea> <6n90jv$51f2@scea> NNTP-Posting-Host: th-eng09-182.pool.dircon.co.uk X-Newsreader: Forte Free Agent 1.11/32.235 On Mon, 29 Jun 1998 21:31:41 GMT, jamin1@psu.edu (Jamin Frederick) wrote: >Ok, here's another problem. How to make an object rotate around separate >pivot points once it is loaded into memory. For instance, if I load a rod >object, and decide to push on one end, the pivot point is no longer in the >center of the rod, but farther at the opposite edge. The question is *how* to >rotate the object now, since I don't want it to go around the old pivot point >(the center), but around the new pivot point. Is there a way to do this >without having to alter the center of the object, which means changing every >single polygon vertex?? what you have to do is the equivalent of how rotations about any non-origin point are done. Usually you translate all points so that the center of rotation is now the origin, rotate, and then do a reverse translation. In the Yaroze system, I would - 1) calculate the translation vector that would move the origin to the center of rotation (in effect, the x,y,z of the center of rotation) 2) rotate the model by however much you want (this will be around the origin) 3) rotate the translation vector from 1) with the same paramters as 2) 4) calculate what translation vector would map the answer from 3) onto the original center of rotation (used in 1)) 5) apply 4) to the whole model. this means you never have to alter the tmd strutcure and move individual vertices. it wont alter the origin for a model but does allow rotation around any point. I hope this is enough, I have somewhere got a routine for calculating rotations and stuff (I used it in revolution to get objects rotating around the ship so you could grab a 2d version of it from their). Ill have a look if youre still stuck Robert Swan rs108@mdx.ac.uk http://www.netyaroze-europe.com/~middex2