1 registered members (Ayumi),
662
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
vec_rotate() algorithm
#352153
01/01/11 16:33
01/01/11 16:33
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Hi!
For a project, I made a visualisation of a vector calculation (with draw_line3d() etc.). Now I want to port the calculation to a micro controller. So I have to code all vec_...() functions for my own. The problem is, that the vec_rotate() algorithm wasn't added to the manual. Does anybody know how to write a function that does something similar? I searched the internet, but it seems to be very difficult => a micro controller isn't that fast, so it should be something with less instructions.
Thanks for your help!
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: vec_rotate() algorithm
[Re: HeelX]
#352167
01/01/11 18:15
01/01/11 18:15
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Thanks for your fast replies! I have no experience with quaternions or matrices... Could somebody give me an example that would be equal to that lite-c code, please?
ANGLE angTemp;
angTemp.pan = 0;
angTemp.tilt = -48;
angTemp.roll = 0;
vec_rotate(vecTemp, angTemp); //rotate vecTemp 48 degrees down
I also looked into some snippets about ratation matrices and it looks very slow (a lot of multiplication and angular functions)...
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: vec_rotate() algorithm
[Re: HeelX]
#352176
01/01/11 19:43
01/01/11 19:43
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I'm only doing rotations by using the tilt. Does that answer your question?
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: vec_rotate() algorithm
[Re: ventilator]
#352182
01/01/11 20:34
01/01/11 20:34
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Got it working Thanks for the hint!
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|