We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Get the result from a rotate
Page Index Toggle Pages: 1
Get the result from a rotate (Read 550 times)
Get the result from a rotate
Jan 8th, 2008, 4:03am
 
Hello,
is there any way in Processing (or Java/OpenGL) I can get the result from an arbitrary rotation? To exemplify, let's say I have a vector (x, y, z) that I want to rotate around the y-axis. But instead of doing the rotation in a pushMatrix, I want to collect the result in an array so that I later can apply faces to a mesh. I've been digging for this info for a while now, and it seems to be possible to do this with java, but to try to understand the java docs and get some useful info from it is somewhat overwhelming to me  ...

I've been trying to achieve the same result using matrices, and it works to a certain point, but gives me some weird results as well. The simplest would really be if there were some function I could use to retrieve these results. Does this even make sense?

Skjaer
Re: Get the result from a rotate
Reply #1 - Jan 9th, 2008, 2:58am
 
Is this what you need?

http://processing.org/reference/modelX_.html

If I understand you correctly you're trying to do a rotation but then get where that rotation ends up being.

Or, you can manipulate rotations yourself doing atan2 for xy, then yz (something like that), that way you'll have the right vector of rotation.
Re: Get the result from a rotate
Reply #2 - Jan 9th, 2008, 4:56am
 
Whhhhaaaaa??

but that's so USEFUL!

why aren't those 3 methods listed in the reference <_<?

edit: --... oh there they are.

Thanks! good info.
Re: Get the result from a rotate
Reply #3 - Jan 9th, 2008, 5:35am
 
mflux, you are my hero Smiley Why didn't I find this before? I even just read the whole book from Casey and Ben, and it was nothing there either! Ah, goodbye ugly matrices and impossible quaternions! There is still hope for the mathematically challenged among us!!

Thanks again mflux Cheesy
Re: Get the result from a rotate
Reply #4 - Jan 9th, 2008, 10:39am
 
np

Just FYI modelXYZ wasn't working as advertised, up until a few months ago where a bunch of us submitted work-arounds and Ben finally nailed it. Possibly the reason why it wasn't in the book.

~M
Page Index Toggle Pages: 1