Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Fods
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location:
Posted: 18th Nov 2002 12:26
Everyone remembers this Famous quote(SOH CAH TOA) from there years in school! its the forumla you use to work out the side of a triange, using Angles.. now this is the only recognition i have of SIN, COS, TAN. now i know its used for angles, but im now shore how i can implement this is being games...
or i need is for someone to explain what there used for and how to use them (in simple terms ) maybe make a few examples to help me out.

thanks alot

Fods
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 18th Nov 2002 13:12
search web for trigonometry (did i spell that right?) tutorials.
there's one here to start ya off:
http://aleph0.clarku.edu/~djoyce/java/trig/
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 18th Nov 2002 16:31
and if that don't help try this:
1.get a paper and pen
2.draw a circle
3.draw a veritcle line going straight through the centre(this will be z axis)
4.draw a horizontal line going through centre (x axis)
(we are looking down from above)
5.draw a line from the centre to the circles perimeter at an angle of roughly 45o (this line is the hypotenuse)
6.draw a line from the point where the hypotenuse is touching the circles perimeter down to the x axis (this line is the height).
7.now draw a line from bottom of height to centre of circle( this line is base)

now you should have a circle with a tringle in it

ok the hypotonuse will represent the radius (this will stay the same)

now imagine the hypotonuse rotates (clockwise or ant-clockwise) its length stays same, but the length of the triangles height(z axis) and base (x axis) will change.

so every time the hypotonuse rotates (angle increases or decreases) we have to calculate a new height and base (z and x)

to workout new height (z axis) do this:
sin(angle)*radius
and the base (x axis) do this:
cos(angle)*radius

ok using these principles i done a little thing to make a sphere rotate around a cube:


these basics can be used for many aspects in game programing:especialy 3d. try changing my program so u can move cube and keep the sphere rotating or add a smaller object rotaing around the sphere which rotates around the cube.
camera positions often require these kind of calculations.
load the text program in the dbp help\examples folder for a 2d use of cos & sin

neway hope that helps

have fun
Mirthin
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Land of the Rising Haggis
Posted: 18th Nov 2002 19:05
I remember SOH CAH TOA. I hate maths with a passion.

This has "Fiasco" written all over it.
crawlin
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 18th Nov 2002 22:57
yep SOH CAH TOA. I quite like maths but I hate circle theroms (? spelling). It looks like i'm gonna have to do A-Level maths as well

Please Visit [Dark-BASIC UK] :: 100% Unofficial Home Of The DarkBASIC Professional Programming
Language - db-pro.co.uk
Mirthin
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Land of the Rising Haggis
Posted: 19th Nov 2002 13:18
Theorem I think.

This has "Fiasco" written all over it.
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 19th Nov 2002 21:50
Hehe! That brings me back. I had a geometry teacher that was a 'little' wierd. When he first Introduced us to Soh cah toa he started talking about an Indian chief who "discovered it" and used it to find distances for hunting buffalo! The aptly named - Sohcahtoa.

He also told us to meat girls at the math bars and have math parties at people's houses. Just a little wacked out!

1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 19th Nov 2002 22:04
you can use it to create that matrix like fx, like the camera rotating round player and pointing at it. there is some kinda formula like:



i think that should work, a and b represent the origin where you want the camera to be rotating around, then you can point the camera where ever (normally at the origin).

there are many other uses but this is just 1

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
Mirthin
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Land of the Rising Haggis
Posted: 19th Nov 2002 23:29
"meat girls?"



This has "Fiasco" written all over it.
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 19th Nov 2002 23:43
Hexgear you have the right idea, but it just needs adjusting.



Use sin and cos for nice rippling effects as well.

Fods
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location:
Posted: 20th Nov 2002 13:39
Thanks a lot for the answers peeps! i have funn expermenting


Login to post a reply

Server time is: 2024-04-25 16:21:43
Your offset time is: 2024-04-25 16:21:43