The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Euler Rotation and 3D Graphics
7 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.
dd ddPosted Oct 26, 2010, 12:33 PM
public static myPoint3d RotateX(myPoint3d point3D, double deg) { double[] retturnData; retturnData[0] = 1*point3D.x; retturnData[1] = Math.Cos(deg2rad(deg))*point3D.y + Math.Sin(deg2rad(deg))*point3D.z; retturnData[2] = -Math.Sin(deg2rad(deg))*point3D.y + Math.Cos(deg2rad(deg))*point3D.z; return new myPoint3d(retturnData); } public static myPoint3d RotateY(myPoint3d point3D, double degrees) { double[] retturnData; retturnData[0] = Math.Cos(deg2rad(deg))*point3D.x + Math.Sin(deg2rad(deg))*point3D.z;; retturnData[1] = point3D.y; retturnData[2] = -Math.Sin(deg2rad(deg))*point3D.x + Math.Cos(deg2rad(deg))*point3D.z; return new myPoint3d(retturnData); } public static myPoint3d RotateZ(myPoint3d point3D, double degrees) { double[] retturnData; retturnData[0] = Math.Cos(deg2rad(deg))*point3D.x + Math.Sin(deg2rad(deg))*point3D.y;; retturnData[1] = -Math.Sin(deg2rad(deg))*point3D.x + Math.Cos(deg2rad(deg))*point3D.y; retturnData[2] = point3D.z; return new myPoint3d(retturnData); } public static double deg2rad(double deg) { return deg*Math.PI/180; } you can remove the point3d and just use the double []
pimvdbPosted May 4, 2010, 3:27 AM
Thank you so much! I got this working, unlike all other code I found... It's extremely cool!
Someone SomeoneeditedPosted Sep 24, 2008, 1:24 PMEdited Sep 24, 2008, 1:27 PM
If you haven't already, check out the next article in this series, with improved 3D plotting and cube shading: C# 3D Cube
Enlai PensadoPosted Sep 11, 2008, 5:29 PM
It's very usable your code thanks a lot.
Yudhistira JoePosted Feb 6, 2008, 9:17 PM
Yes, this is a very good article. Thanks VCKicks! Question, where can I find the distortion algorithm (or can you send me?). I want to attach my photo at the 3D cube surface.