Rotating a Bitmap in 3D - Code example?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 10 October 2012   #1
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!
Old 10 October 2012   #2
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
Old 10 October 2012   #3
Thank you, Nick. I'll check it out.
Old 10 October 2012   #4
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 - Rigging from First Principles
Old 10 October 2012   #5
Thanks Jaco. I'll try that out.
Old 10 October 2012   #6
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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:52 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.