Printable Version of Topic

Click here to view this topic in its original format

914World.com _ 914World Garage _ OT: Math Question ...

Posted by: SirAndy Dec 30 2004, 11:21 PM

stupid question (what else is new) ...

while working on my 3D-Editor/Game Engine i came to realize that the default Rotation Matrix for OpenGL uses a counterclockwise winding for Rotations around the Y-Axis (Yaw), meaning if you look at a Object in the XZ Plane a Positive Angle will Rotate the Object Left, a Negative Angle will Rotate it Right.

This is Counter-Intuitive and i am wondering if there is a rule for this behavior in a Cartesian coordinate system or is this merely a "personal preference" for OpenGL ???

My editor currently uses the clockwise approach, where a positive angle rotates the object to the right instead, which seem much more intuitive.

searching the web, i have found both approaches, but i would like to know if there's a "corret" way to do it ...

IPB Image Andy

Posted by: dinomium Dec 30 2004, 11:32 PM

polar coordiantes are mesured anti clockwise...

Posted by: SirAndy Dec 30 2004, 11:44 PM

QUOTE (dinomium @ Dec 30 2004, 09:32 PM)
polar coordiantes are mesured anti clockwise...

alright, so this would be the correct matrix then:

cos(angle)0sin(angle)
010
-sin(angle)0cos(angle)



hmmmm, maybe i will just make it an option for the enduser ...
IPB Image Andy

Posted by: dinomium Dec 31 2004, 01:00 AM

two quotes for you:
Chevy Chase as President Ford "It was my understanding there would be no math..."
or
Malibu Barbie "Math is Hard!"

IPB Image either way that is just more trig than I care to remember... and not this close to new years!!

Posted by: swood Dec 31 2004, 01:14 AM

Shoot. I thought this was going to be one of those impossible to solve problems about two trains leaving at the same time travelling towards each other at different speeds. IPB Image

Posted by: Gint Dec 31 2004, 01:27 AM

Looks like A.f.d bait to me... IPB Image

Posted by: trekkor Dec 31 2004, 02:55 AM

I was hoping this was some sort of game with a fake prize. IPB Image

KT

Posted by: Steve Thacker Dec 31 2004, 07:01 AM

That's some deep doo-doo Andy..... you flipping developers kill me. IPB Image

Sounds like the rare matting call to attract Alfreds.

Almost like Jennette MacDonald and Nelson Eddy I'm calling yooooo hoooo IPB Image


Sorry Andy I couldn't resist IPB Image

Posted by: Red-Beard Dec 31 2004, 07:12 AM

QUOTE (swood @ Dec 30 2004, 11:14 PM)
Shoot.  I thought this was going to be one of those impossible to solve problems about two trains leaving at the same time travelling towards each other at different speeds.  :blink:

_YOU_ are the engineer on a train traveling from New York City to Chicago...

Yeah, Standard Polar coordinates are counter clockwise. And they were derived from Standard Carteasean coordinates.

Posted by: Racer Chris Dec 31 2004, 07:32 AM

Think of it this way: in an xy plot of a ray beginning at the origin, as the slope increases from zero to ninety degrees (and beyond) - the ray rotates in a counterclockwise direction.
Everything else follows from this example.

Posted by: rick 918-S Dec 31 2004, 08:24 AM

What some people solve with math others would solve with a hammer. Hit the coil until you loosen the wires. Then wind them the other way. This should achieve what your after without changing the math. IPB Image

Posted by: Curvie Roadlover Dec 31 2004, 08:39 AM

Maybe there's someone out there that could post some scanned articles from old Road and Track issues to explain this IPB Image IPB Image

Posted by: michel richard Dec 31 2004, 10:24 AM

QUOTE (rick 918-S @ Dec 31 2004, 06:24 AM)
What some people solve with math others would solve with a hammer. Hit the coil until you loosen the wires. Then wind them the other way. This should achieve what your after without changing the math. IPB Image


Th best quote in a long, IMHO.

Posted by: john rogers Dec 31 2004, 10:36 AM

I teach a couple of graphics classes using OpenGL and somethings are not really sensible to us normal people?! Try this website as there are many really good tutorials and explanations: http://nehe.gamedev.net/

Posted by: KaptKaos Dec 31 2004, 10:40 AM

"It's a farging trick question!" - Roman Maronie

Posted by: Bruce Allert Dec 31 2004, 10:43 AM

/ v <=> b:© + h(M)

/ angle
v dangle
<=> proportional to
b: beauty of
c cutie
h heat
m meat


IPB Image .........einstein IPB Image

.........b

Posted by: Sammy Dec 31 2004, 11:18 AM

My cat's breath smells like cat food.

Posted by: sgomes Dec 31 2004, 12:05 PM

As Homer said:

Y're all nuts. I'm goin' to Moe's.

Posted by: SirAndy Dec 31 2004, 01:54 PM

QUOTE (Red-Beard @ Dec 31 2004, 05:12 AM)
Standard Polar coordinates are counter clockwise. And they were derived from Standard Carteasean coordinates.

that's what i wanted to know. the math is easy, just didn't know if there was a "right" way to do it.

counter-clockwise it is then ...

easy enough,
IPB Image Andy

PS:
QUOTE
http://nehe.gamedev.net/
alreayd bookmarked for quite some time now ...

PPS:
QUOTE
My linear algebra is rustier than the "hell hole"
that's why i didn't ask you in first place, plus, you just can't seem to give an simple answer to a simple question ...

Posted by: rick 918-S Dec 31 2004, 06:22 PM

QUOTE (SirAndy @ Dec 31 2004, 11:54 AM)


PPS:
QUOTE
My linear algebra is rustier than the "hell hole"
that's why i didn't ask you in first place, plus, you just can't seem to give an simple answer to a simple question ...

IPB Image I still think it's easier to rewind the coil. IPB Image

Posted by: URY914 Dec 31 2004, 06:30 PM

I had a diesel engine that would run backward.
I didn't even have a coil.

Pie=MCsquared

And if the pie is hair pie, it is cubed. IPB Image

Paul

Posted by: kwales Dec 31 2004, 06:33 PM

Sor Ahndie...

Is this code going to be used in the northern or the southern hemisphere?

Ya know you have to be counter clockwise in the northern hemisphere and clockwise in the southern hemisphere.

Magnetic fields reverse in the southern hemisphere, water spins in the opposite direction as it drains, monitors become unaligned, and a lot of the rules change down there.......

Bet you didn't know that...... IPB Image

Ken

Posted by: SirAndy Dec 31 2004, 07:35 PM

QUOTE (kwales @ Dec 31 2004, 04:33 PM)
Is this code going to be used in the northern or the southern hemisphere?

it's going to be "universal".
which means, you'll have to float in space to be able to use it ...

IPB Image Andy

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)