Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (3run, AndrewAMD), 623 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rotation around Arbitrary Axis #367328
04/12/11 01:13
04/12/11 01:13
Joined: Apr 2011
Posts: 4
R
Ralaman Offline OP
Guest
Ralaman  Offline OP
Guest
R

Joined: Apr 2011
Posts: 4
Anyone know how to rotate a entity around arbitrary axis.
Like the moon arround the earth?

thx

Last edited by Ralaman; 04/12/11 01:14.
Re: Rotation around Arbitrary Axis [Re: Ralaman] #367329
04/12/11 01:24
04/12/11 01:24
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
I like to use cos and sin but vec_rotate is pretty good


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Rotation around Arbitrary Axis [Re: FoxHound] #367330
04/12/11 01:25
04/12/11 01:25
Joined: Apr 2011
Posts: 4
R
Ralaman Offline OP
Guest
Ralaman  Offline OP
Guest
R

Joined: Apr 2011
Posts: 4
Can u show me a exemple plz?

Re: Rotation around Arbitrary Axis [Re: Ralaman] #367332
04/12/11 01:30
04/12/11 01:30
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
When o get on a computer And not my phone I can. Till then check the manual.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: Rotation around Arbitrary Axis [Re: FoxHound] #367333
04/12/11 01:31
04/12/11 01:31
Joined: Apr 2011
Posts: 4
R
Ralaman Offline OP
Guest
Ralaman  Offline OP
Guest
R

Joined: Apr 2011
Posts: 4
Well i worked i little whit vec_rotate but i dont get the right solution yet =(

And that add me another problem... i want my entity to pan correctly following the rotation arround the axis.

How i can add a image to the post? It need to be in a http link?

Last edited by Ralaman; 04/12/11 02:41.
Re: Rotation around Arbitrary Axis [Re: Ralaman] #367336
04/12/11 05:54
04/12/11 05:54
Joined: May 2009
Posts: 5,367
Caucasus
3run Online
Senior Expert
3run  Online
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Simply like this:
Code:
var offset = -100; // decrease to increase distance
camera.pan += 10 * time_step;
camera.x = my.x + fcos((camera.pan),fcos(camera.tilt,offset));
camera.y = my.y + fsin((camera.pan),fcos(camera.tilt,offset));
camera.z = my.z + 40 + fsin(camera.tilt,offset);

This example shows how to make camera that moves around the player (MY);


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Rotation around Arbitrary Axis [Re: 3run] #367366
04/12/11 15:44
04/12/11 15:44
Joined: Oct 2009
Posts: 149
Germany
M
muffel Offline
Member
muffel  Offline
Member
M

Joined: Oct 2009
Posts: 149
Germany
Quaternion or simple use this function:

ang_for_axis(ANGLE* vAng, VECTOR* vAxis, var angle)

muffel

Re: Rotation around Arbitrary Axis [Re: muffel] #367368
04/12/11 16:37
04/12/11 16:37
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Another way to set up the camera easily is

camera.x = my.x + 200 * cos(my.pan)
camera.y = my.y + 200 * sin(my.pan)
As is the camera will move around the player but the pan of the camera won't pan. Throw in Camera.pan = player.pan; and it will fix that.

try

camera.x = my.x + 200 * cos(camera.pan)
camera.y = my.y + 200 * sin(camera.pan)
camera.pan += well anything

That way you can choose in another way how to orbit the camera or anything for that matter around a point.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1