Sin/Cos Lookup Tables

Blitz3D Forums/Blitz3D Programming/Sin/Cos Lookup Tables

Of course the lookup table is generated at startup of the app, so different processors generating different results won't be solved by this ??

Indeed BlackJumper,
the trick here is to build up a look-up table once, on your development pc, and store the values in Data statements.

Then, pick the values from the data statements to fill up two arrays like my_sin() and my_cos(), and use my_sin(angle) instead of sin(angle) to retrieve the values.

In this way you are sure that all the pcs will use the same values - because they are not calculated, but red from data statements - that is, they are constant.

This is the way I solved the 'different values on different pcs' issue.

Hope this has sense for you,
Sergio.