Advertisement

To learn OpegnGL... w/o knowing 3d math?

Started by April 04, 2001 01:19 AM
8 comments, last by Some Guy 23 years, 10 months ago
Man it''s discouraging when I look into a book or guide on an API I want to learn and it says I need to know all this math before I can learn this. The OGL Red Book did this and I was absolutely pissed. So, here are the facts: -I want to learn OpenGL. -I don''t know much 3d math. I know it''s necessary for really hard stuff, but how much do you really need to start out with? -The Skipper loves Gilligan, but that''s another story... Help me or I''ll reveal your girlfriend''s secret!
Vector with Dot product & Cross product

Thats about all you really need to rock on. That''ll cover things like normal generation.

Just download someone elses classes and use them, glvelocity has a few..

Read up at NeHe, that''ll get you started in opengl. If you want to learn some vector math look at the geometry primer at flipcode.

Matricies are kind of cool, remember that a matrix is just a container for loads of small math functions and not some special entity and you''ll be fine.


...I did this about 2-3 months back and am currently building a full renderstate managing scene graph.

Get an only HS textbook on trig, learn sin\cos\tan or at least what they represent and the reason you use them should allow you to ''see'' what they do..

Luck...
Chris Brodie
Advertisement
So did you stop reading after you read that? Keep going and if you find some maths that you don''t understand, post a question.

OGL is as simple or as complicated as you want to make it. Start with nehe''s tutorials and use them alongside the redbook

-DeVore
Yeah, I get discouraged pretty easily whenever I get riled up on learning something. I''m gonna have to learn to just not get riled up, I guess.

Anyway, there are a few math questions I have:
-What really are sine, cosine, tangent and hypotenuse (did I spell them right?)?


Okay so it''s not really a few questions, just one for now anyway.
I suggest u to learn 3d mathematic fundamentals!!! It''s very simple! fede
cos, sin, tan are trigonmetrical functions (I am German,i hope i spell the things I say right)
In most cases they are used for calculations with angles. But I think learning them is not very difficult. Looks like I have the math, but I can''t program OpenGL! I am coding on a HL Mod, so I have a finished Engine to use.
But I''m very interested in coding my own Engine. Anybody knows some Sites for OpenGl headers classes and sourcecodes? OpenGL was developed by Silicon Graphics, right?
Delevelopment is an attitude of mind
Advertisement
Ok, some basic trigonometry here:

/|
/ |
/ |
c / | b
/ |
/ |
/______|
a

c is the hypotenuse
if v is the angle between a and c, then:

sine(v) = b/c
cosine(v) = a/c
tangent(v) = b/a

Oh, and that thing up there is a triangle
cos, sin, tan are trigonmetrical functions (I am German,i hope i spell the things I say right)
In most cases they are used for calculations with angles. But I think learning them is not very difficult. Looks like I have the math, but I can''t program OpenGL! I am coding on a HL Mod, so I have a finished Engine to use.
But I''m very interested in coding my own Engine. Anybody knows some Sites for OpenGl headers classes and sourcecodes? OpenGL was developed by Silicon Graphics, right?
Delevelopment is an attitude of mind
cos, sin, tan are trigonmetrical functions (I am German,i hope i spell the things I say right)
In most cases they are used for calculations with angles. But I think learning them is not very difficult. Looks like I have the math, but I can''t program OpenGL! I am coding on a HL Mod, so I have a finished Engine to use.
But I''m very interested in coding my own Engine. Anybody knows some Sites for OpenGl headers classes and sourcecodes? OpenGL was developed by Silicon Graphics, right?
Godofviolence check http://nehe.gamedev.net/opengl.asp for some OpenGL tutorials.

Here''s some basic trig (since the AP''s post didn''t turn out right) and some other basic triangle math (algebra and geometry). Most of this is off the top of my head (not all of it ), so excuse any errors.
             . <-- Angle b             |\             | \             |  \             |   \                      <- Triangle =P      Side A |    \  Side C             Angles are lower case             |     \                    Sides are upper case             |      \             |       \             |        \Angle c -->  |_________\ <-- Angle a               Side B 

a+b+c = 180° = pi radians
A² + B² = C²
C = The hypotonuse (sp?)

Angle a is side A''s angle.
Angle b is side B''s angle.
Angle c is side C''s angle.

sin (angle of a side) = (opposite side)/(hypotonuse)
cos (angle of a side) = (adjacent side)/(hypotonuse)
tan (angle of a side) = (opposite side)/(adjacent side)
arcsin (opposite side)/(hypotonuse) = (angle of the side)
arccos (adjacent side)/(hypotonuse) = (angle of the side)
arctan (opposite side)/(adjacent side) = (angle of the side)

s, t, and x are angles:
sin² (s) + cos² (s) = 1
sin (s+t) = (sin s)(cos t) + (cos s)(sin t)
sin (s-t) = (sin s)(cos t) - (cos s)(sin t)
cos (s+t) = (cos s)(cos t) - (sin s)(sin t)
cos (s-t) = (cos s)(cos t) + (sin s)(sin t)

sin (2x) = 2 (sin (x)) (cos (x))
cos (2x) = (cos² (x)) - (sin² (x))

sin² (x) = (1 - cos (2x)) / 2
cos² (x) = (1 + cos (2x)) / 2

csc (angle) = 1 / (sin (angle))
sec (angle) = 1 / (cos (angle))
cot (angle) = 1 / (tan (angle))
tan (angle) = (sin (angle)) / (cos (angle))
cot (angle) = (cos (angle)) / (sin (angle))

Here''s some weird ones .

The law of cosines:
A² = B² + C² - (2CB*(cos a))

The law of sines:
sin a   sin b   sin c----- = ----- = -----  A       B       C 


"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
Resist Windows XP''s Invasive Production Activation Technology!
http://druidgames.cjb.net/

This topic is closed to new replies.

Advertisement