Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Good stuff to know: trig basics (https://forums.graalonline.com/forums/showthread.php?t=38581)

prozac424242 09-26-2002 08:12 AM

Good stuff to know: trig basics
 
Here are some good fundamentals of trigonometry
that i remember being some quesitons from some
of you folks out there, on trig.

Its good to have this under your belt to create
some cool effects in graal.

http://online.cctt.org/physicslab/co...igonometry.asp

prozac424242 09-28-2002 10:13 AM

hmmm
 
hmm, good script kai

BUT ...

Quote:

we don't even need to continually use sin and cos
and i see in the script ...

Quote:

this.s=sin(this.anginc);
this.c=cos(this.anginc);
so .. to not use sin and cos ...
lets see.. ya, lets use sin and cos!

R0b1n-NPC 09-28-2002 10:17 AM

He does not use it continually though.

He uses it once in the created event but not in the timeout.

prozac424242 09-28-2002 10:26 AM

hmm
 
ok. i misread the context of the word "continually".
it could have meant, "in every script we use from here on out"
or it could have meant "in the timeouts of the scripts"

Torankusu 09-28-2002 10:32 AM

Re: hmmm
 
Quote:

Originally posted by prozac424242
hmm, good script kai

BUT ...



and i see in the script ...



so .. to not use sin and cos ...
lets see.. ya, lets use sin and cos!

"continually..."

Graal2001_Developer1 09-28-2002 03:52 PM

is one precalculation with sin and cos so much faster? I don't think it takes so much speed even if you do it continously in a timeout or another loop :/

Graal2001_Developer1 09-29-2002 04:24 AM

Quote:

Originally posted by Kaimetsu


It's many, many times faster. Do you know how sin and cos functions work? How they calculate the return values from the inputs? If so, you'll understand my point. It's true that repeatedly accessing sin and cos is fast enough for most purposes, but efficiency is a huge part of being a good scripter. If you ever wanna make something complicated like a 3D engine then you'll be glad of an alternative to slow trigonometric functions.

actually it was fast enough for everything I've done with it and there'll probably be no other person then you who even tries to add a 3D engine to Graal ;)

@ know how to calculate -> my math teacher was a lazy guy back then (who probably did not know how to) so we just used calculators to get sinus and cosinus-values... -_-

WanDaMan 09-29-2002 04:43 PM

To complicated>.


All times are GMT +2. The time now is 08:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.