Xref: utzoo rec.games.programmer:3375 alt.msdos.programmer:2549 comp.os.msdos.programmer:4554 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!mips!cs.uoregon.edu!ogicse!usenet! From: murrayk@prism.CS.ORST.EDU Newsgroups: rec.games.programmer,alt.msdos.programmer,comp.os.msdos.programmer Subject: 3D rotation update Summary: more detailed info and thanks... Keywords: 3D, rotation, real, thanks Message-ID: <1991Apr10.191212.5249@lynx.CS.ORST.EDU> Date: 10 Apr 91 19:12:12 GMT Sender: @lynx.CS.ORST.EDU Organization: Oregon State University, Computer Science Dept. Lines: 49 Nntp-Posting-Host: prism.cs.orst.edu Ok, here we go. First of all I would like to thank all the people that were kind and knowledged enough to reply to my cry for help. I received a lot of mail and postings that helped me to find some new books to look through and some actually sent me some code. I tried to reply to all of you who sent me something or posted something, but I am sure that I missed a few...so if you didn't already hear thanks, then thanks. Next, in most of the replys I got people rehashed just what I have already been doing. Here is my most immediate problem in a lot more detail. I can draw and rotate an object on the screen around the x, y and z-axis all day long. The only problem is that each axis that I rotate around is the corresponding axis of the monitor (what you actually see). Now, what I want to do is to be able to rotate the object around its own three axes (virtual axes). For example, say the object is a tetrehedron with its base in the xy plane (the yz plane is sticking in your face) and its top point in your face. The object is situated so that the z-axis is a line running though the top point and the middle of the base. Now say that I rotate this object around the x axis about 30 degrees so that the point is now partially up the screen. Now if I was to rotate the object about the z-axis as my code now exists, the top point of the tetrehedron would sweep out a circle on the screen. This problem could be solved by doing the rotations in a certain order, but that screws up as soon as you rotate about the third axis. What the object should do if it is rotated about the z-axis (its z-axis) would be to spin along the imaginary line running though its top point and its base. But alas, I cannot get this to happen. In consulting a few graphical technique books, I found out exactly how to do a rotation about an arbitrary line. I figured that if I kept the axes of the object in the data of the object itself and rotated the axes along with the object, then I would be able to do an arbitrary rotation about those axes and voila, it would work. I tried this and have had no luck. My code has been gone over with a fine toothed comb (my own and a friends) and no problem can be found. If anyone has experience in this area of 3D rotation, please keep posting. If I am just missing a small point, don't flame me. I will see it soon enough. I am bound to find out what I am missing eventually. All your help is appreciated. Thanks a lot, Keith Murray -------------------------------------------------------------------------------- CHAOS Software Software for someone... 1360 NW VanBuren Keith Murray a.k.a. Slammer Corvallis, OR 97330 murrayk@prism.cs.orst.edu --------------------------------------------------------------------------------