There are faster ways to calculate sin/cos. The easiest would be a lookup-table with a fixed number of values. Use this together with linear interpolation and you should be fine. Also, if you are using msvc to write your code you can put
#pragma intrinsic( sin, cos )
in your source code to instruct the compiler to use built-in FPU-support for those functions. It's still somewhat slow. To speed things up even more you could use MMX/SSE-code to calculate sin/cos. Intel provides a library that uses this approach. Take a look at the "Approximate Math Library" here: http://cedar.intel.com/cgi
.f
Main Topics
Browse All Topics





by: SuperMarioPosted on 2002-11-03 at 20:01:13ID: 7404306
Fixed it using trig... Never thought I'd use that.
Is there a faster way to do it? I just used translate with sines and cosines, but it's probably a performance hit.