So it took me some time to figure out how hinges are rotated in Newton. They must be rotated with vector, but I'm having math issues how I convert angles to that format.
Easy angles are 0,90,180 and 270 they are indicated like this(respectively):
NDB_SetVector 2, 1.0, 0.0, 0.0
NDB_SetVector 2, 0.0, 0.0, -1.0
NDB_SetVector 2, -1.0, 0.0, 0.0
NDB_SetVector 2, 0.0, 0.0, 1.0
Then it gets a bit more difficult, middle angles 45,135,225 and 315 respectively:
NDB_SetVector 2, 0.5, 0.0, -0.5
NDB_SetVector 2, -0.5, 0.0, -0.5
NDB_SetVector 2, -0.5, 0.0, 0.5
NDB_SetVector 2, 0.5, 0.0, 0.5
But how do I make a convertion of angles like 113 degrees, or 277 degrees, so that I don't have to figure them out separeately?
I tried to come up with converter, but I can't figure anything out for angles 270<rx#<360... And that converts only the other half of the values.
if rx#<=90 then Zang#=-rx#/90
if rx#<=270 then if rx#>90 then Zang#=(rx#-180)/90
if rx#>270 then Zang#=(rx#-180)/90
Here is image that will confuse you even more>
I don't know am I tired, but I can't come up with wise solution for this.