# Rotating a Bitmap in 3D - Code example?

 10 October 2012 #1 DePaint Banned   portfolio Emre M. Istanbul, Turkey   Join Date: Jun 2008 Posts: 1,156 Rotating a Bitmap in 3D - Code example? I'm trying to write a function that rotates a Bitmap around the Y-axis in 3D: Anyone know of a code example in c#, c++, Java et cetera that performs a 3D rotation of a bitmap? I'm not looking for a built-in "bitmap.rotate" function. I'm looking for the low-level method for writing my own bitmap 3D rotation function. Thanks for any help! share quote
 10 October 2012 #2 ndeboar Expert   portfolio CGConnect Member Nick Deboar Lighting TD AU   Join Date: Nov 2004 Posts: 1,188 Check out rotation matricies: http://en.wikipedia.org/wiki/Rotation_matrix If i can find some source code, ill post it, but transformation matricies are the basis of most moving/scaling/rotations functions share quote
 10 October 2012 #3 DePaint Banned   portfolio Emre M. Istanbul, Turkey   Join Date: Jun 2008 Posts: 1,156 Thank you, Nick. I'll check it out. share quote
 10 October 2012 #4 ThE_JacO Cultist   portfolio CGConnect Member Raffaele Fragapane Performance Technology Supervisor Animal Logic Sydney, Australia   Join Date: Jul 2002 Posts: 10,955 For the record, you're not as much after rotating something in 3D, which in the case you point out could be done with some extremely simple geometric work, as much as you are about dealing with perspective. What you show there isn't rotating di per se', as much as it's finding the screen space through a perspective camera of that object. Without a camera implementation of some sorts you might as well fake the transform in 2D and eyeball it (by moving the points in X by an inversely proportional amount of their Y offset, and redistributing the "depth" pixels somewhat arbitrarily within that transform). __________________ Come, Join the Cult http://www.cultofrig.com - Rigging from First Principles share quote
 10 October 2012 #5 DePaint Banned   portfolio Emre M. Istanbul, Turkey   Join Date: Jun 2008 Posts: 1,156 Thanks Jaco. I'll try that out. share quote
 10 October 2012 #6 CGTalk Moderation Expert   Join Date: Sep 2003 Posts: 1,066,473 Thread automatically closed This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.