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.

Dark GDK / Limb Rotation Sin Cos i can ;)

Author
Message
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 24th May 2011 01:59
I'm a moron when it cums to Sin and Cos, I got this to work but I think there is prolly a way that is easier on the processing.

Is this computationally intence? Will it slow down my simulation if I did this like 100times per-sync?

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 24th May 2011 08:05 Edited at: 24th May 2011 08:06
Quote: "Will it slow down my simulation if I did this like 100times per-sync?
"


Yes. All calculation is done by CPU, if you do that 100 Times per Loop you will notice some fps drops. But i believe sin and cos arent that heavy (you can always make your own less heavy on the cpu). Altough Sqrt is VERY heavy on CPU, dont use that too often.

Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 29th May 2011 21:24 Edited at: 13th Jun 2011 04:18
Ahh thanks much for the info on the sqrt()

Much appreciated.

More info on what is heavy on the cpu, would also be much appreciated.

the code is used like this up to like around 34 times a step - how many times varies 0-3900

actually im just going to put the code here.





Because I want help finding the proper value for the variable
Quote: "att"


lol its driving me madd.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 30th May 2011 22:44
Well, I didn't read the second (longer) code snippet, but regarding the sin and cosine thing:

If you have a certain range of values that are possible (like angles from 0 to 359), you could also pre-compute all values and store them in an array to speed it up! But then you have to cope with inaccuracies or find a workaround...
Anyway here is an example to show what I mean:



Hope this helps a bit...

Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 31st May 2011 02:51
Ya but only things that can be precomputed.. like limb length;
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 1st Jun 2011 11:23
Aaah I see what you meant now. I personnally like to use a Lookup Table, Pauli gave you a very good base of it.

But have a look at this, it is explained very well with some good code examples.

http://en.wikipedia.org/wiki/Lookup_table

Login to post a reply

Server time is: 2024-10-02 17:28:27
Your offset time is: 2024-10-02 17:28:27