gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > libnds 1.3.1, degrees and rotations

#166073 - Rajveer - Mon Jan 26, 2009 12:15 am

Do gl rotations still use a circle with 512 degrees? I know they now go from 0 - 32768, but the lowest value I seem to be able to use for a rotation is 64, which is the same as 1 out of 512.

If so, what's the point of the new 360 deg functions?

#166076 - dovoto - Mon Jan 26, 2009 1:58 am

Trig functions in libnds now use a 32768 "degree" unit circle. 32768 would correspond to one complete circle where as before 512 would correspond to one complete circle.

The reason for this is more precision in the representation of an angle. Several people had hinted that the 512 unit circle was not fine grained enough.
_________________
www.drunkencoders.com

#166079 - Rajveer - Mon Jan 26, 2009 3:37 am

Wow, just reread my post, sorry for the "what's the point", made it sound like I don't appreciate the work :S

Do the glRotate functions accept all angles from 0 to 32768? The comments still say angles from 0-511 are accepted and I can only manage to get them to work within intervals of 64, but if it uses the trig functions then surely I must be doing something wrong!

#166081 - relpats_eht - Mon Jan 26, 2009 9:14 am

Are you passing the values as f32's? The new trig functions take an f32 between 0 and 512, so that may be your problem, by which I mean, you are actually passing 4096 instead of 1.

And I've been meaning to ask, not to derail the thread or anything, but why has arcTanLerp been commented out? It only needs
Code:
if(angle > inttof32(128)){
   angle = inttof32(128);
}

at line 251 for completion.
_________________
- relpats_eht