SetRotation(90) points 'down'

BlitzMax Forums/BlitzMax Beginners Area/SetRotation(90) points 'down'

Schwang(Posted 2008) [#1]
Everything I know about trig tells me that 90 degrees points 'up' while 270 points 'down', yet this seems to be the reverse in BlitzMax.

Is everything I know about trig wrong? ;P


Brucey(Posted 2008) [#2]
In your trig your origin is probably bottom-left (y -> up), rather than top-right (y -> down)?


Digital Anime(Posted 2008) [#3]

In your trig your origin is probably bottom-left (y -> up), rather than top-right (y -> down)?



Had the same with Sin and Cos and expected a different result the first time. Normally in math y + 1 means going up, but in BlitzMax y + 1 means going down.


Schwang(Posted 2008) [#4]
Thanks DA, that's what I'm getting at. School-taught maths (which is all I bring to my less-than-uba-leet Blitz shenanigans) teach you that y increments upwards, as seen here:
http://en.wikipedia.org/wiki/Unit_circle
(Scroll down to see the big unit circle, indicating 90 as up and 270 down)

BlitzMax does flip this upside-down (thanks again DA). Now I've confirmed that Blitz does see 90 as down I can carry on working this way (or alternatively always use a negative rotation to invert it), but is there a reason Blitz works like this?


Digital Anime(Posted 2008) [#5]
but is there a reason Blitz works like this?


Yes, left top coordinates in graphics mode is always 0,0 which is the starting point. So it seems only logical when looking a bit deeper into this.


Schwang(Posted 2008) [#6]
I've a lightbulb over my head now. That makes perfect sense, thanks DA.


Schwang(Posted 2008) [#7]
All this is of course exactly what Brucey said - thanks man, didn't mean to ignore you, it only started making sense a bit later on once my brain thunked it over ;)


TomToad(Posted 2008) [#8]
It isn't just BlitzMAX that does this, but most 2D graphics engines do this. Mainly because CRTs scan from top to bottom, so it makes sense to map memory that way.

And just wait until you get into 3D.
Y is up again, and z is either away from you or towards you depending on whether you are using right-handed or left-handed coordinate system.


Floyd(Posted 2008) [#9]
I think it dates back all the way to when computers were "text only".

Print commands also use a coordinate system and the origin is naturally at the upper left, where you begin reading. You advance by moving to the right and down.