userlib problem

Blitz3D Forums/Blitz3D Userlibs/userlib problem

Spike314(Posted 2008) [#1]
hi all

im trying to make a userlib and trying to access the rotation of a entity in my dll and get the angle but i can't convert it into degrees can anyone help?

example:
this is how i get the angles
Peekf(entity+48)
Peekf(entity+52)
Peekf(entity+56)
Peekf(entity+60)



Charrua(Posted 2008) [#2]
Hi

sorry, Peekf is for Peek a float from a bank? (PeekFloat(bank,offset))
what is entity?
I supose that 48, 52, 56, 60 are offsets in a structure with elements of 4 bytes in size, but I can't realize what is all about!

should you explain further?

Juan


Spike314(Posted 2008) [#3]
Im trying to access blitz3ds entity rotation from purebasic to make a userlib i no that the offset of 48 52 56 60 are the angles but it dones not return them in degrees and im trying to convert them in to degrees and i was hoping someone would no how to do this.


Charrua(Posted 2008) [#4]
should be floats?
or no idea?
does you have any technical documentation?

Juan


boomboom(Posted 2008) [#5]
I believe blitz stores rotations in quaternians.


Charrua(Posted 2008) [#6]
well, then there all 4 are floats!

see:

http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

and have a nice day (or headache!)

Juan


MikhailV(Posted 2008) [#7]
See Blitz3D entity structure HERE
Quaternion saved at $30 (hex) disp.

And other structures here — http://blitz.pp.ru/forum/showthread.php?s=&threadid=203

Some data can not coincide with B3D 1.99, these tables are made for old version Blitz3D !


Charrua(Posted 2008) [#8]
Great info

($30 = 48 as Spike says)

thank's for the link, the names of the gifs ara so clear
(not the rest, I speak Spanish )!


Juan


MikhailV(Posted 2008) [#9]
@Odriozola Almeida: And I speak in Russian, it has not prevented to make to me the given tables :P


Charrua(Posted 2008) [#10]
about quaternions, see:
http://www.blitzmax.com/codearcs/codearcs.php?code=490

@MikhailV hey, was a joke! (sorry if I offense you, wasn't my intention)

best regards

Juan