|10 October 2012||#1|
Join Date: Jun 2008
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!
|10 October 2012||#2|
Join Date: Nov 2004
Check out rotation matricies:
If i can find some source code, ill post it, but transformation matricies are the basis of most moving/scaling/rotations functions
|10 October 2012||#4|
Performance Technology Supervisor
Join Date: Jul 2002
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
|Thread Closed share thread|