Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 938 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: 3-dimensional camera rotation [Re: BastovBros] #276871
07/06/09 20:59
07/06/09 20:59
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
OK, another problem, but I decided to explain it here instead of creating a new topic. The question is: how can I make the cursor appear in the center of the screen after loading the level, so that its new central coordinates become the initial position of the mouse? And how can I make limits for the cursor movement on the screen?
Thank you in advance.


a generator of dull questions smile
Re: 3-dimensional camera rotation [Re: BastovBros] #278969
07/16/09 10:14
07/16/09 10:14
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
And again another question:
I have an entity that can roll, pan and tilt... though I can't make it rotate around its axises in the local coordinates. Like this, when the pan and roll angles equal 0, I press "w" and change the tilt rotation "vector(0, 10*timestep,0)", and the entity rotates around its y-axis... But when I roll the entity right a little by pressing "e", and then press "w" again to tilt it, it rotates still in the global coordinates so tilt upwards and not diagonally right-upward .....


a generator of dull questions smile
Re: 3-dimensional camera rotation [Re: BastovBros] #279023
07/16/09 12:30
07/16/09 12:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
With your positioning the cursor, I have no idea. But check the manual under
"mouse_mode" and it will lead you there, Im sure.

But for your entity rotating, you are wrong.
Pan, Tilt, and roll are "local" rotations, your entity is panning, tilting, and rolling
as you expect. (well, according to your last code-post it is)
BUT the camera is being moved around too, which is 'hiding' the effect.
Disable the camera code and you'll see.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: 3-dimensional camera rotation [Re: EvilSOB] #279059
07/16/09 13:53
07/16/09 13:53
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
The question with cursor is already solved, I don't need positioning it to the center any more...

And about rotation, I don't know why but tilt does not perform as a local rotation...Here is a sequence of screenshots for more detail:
1. all angles = 0

2. Change the tilt angle , the plane goes upward.

3. Roll the plane a little to the left

4. But when I tilt it again the plane still goes upward (solid arrows) instead of rotating along its local coordinates (dashed arrows)


Here's the code I'm using:
var rotation_coef = 10;
...
action()
while(1){
...
if (key_w) { player.tilt -= rotation_coef * time_step;}
if (key_s) { player.tilt += rotation_coef * time_step;}
if (key_a) { player.roll -= rotation_coef * time_step;}
if (key_d) { player.tilt += rotation_coef * time_step;}
wait(1);
....
}

Any ideas why ithis happens?


a generator of dull questions smile
Re: 3-dimensional camera rotation [Re: BastovBros] #279064
07/16/09 14:00
07/16/09 14:00
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Have a look at the manual:
1: c_rotate with mode USE_AXIS / USE_AXISR
2. ang_add / ang_rotate

Re: 3-dimensional camera rotation [Re: Widi] #279070
07/16/09 14:04
07/16/09 14:04
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Yeah, just use c_rotate with USE_AXIS, that should do the trick. It works here...


~"I never let school interfere with my education"~
-Mark Twain
Re: 3-dimensional camera rotation [Re: Germanunkol] #279188
07/16/09 20:31
07/16/09 20:31
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
"works here" is where? OK, never mind..... I'll try tomorrow smile
Well, tomorrow came earlier than I expected laugh I tried the code, it works perfectly with USE_AXISR var mode...
I made an attempt to use the c_rotate function yesterday, though I used USE_AXIS, and it didn't work.... why the hell I didn't try the USE_AXISR instead (O_o)

Thanks to all for assistance grin

Last edited by BastovBros; 07/16/09 20:50.

a generator of dull questions smile
Re: 3-dimensional camera rotation [Re: BastovBros] #279660
07/18/09 16:33
07/18/09 16:33
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
Another problem with global rotation...
As I understand player.tilt responds to global rotation of the player.. I've checked this by changing the tilt value in th console with running engine:
player.tilt = 0;
player.tilt = 10;
player.tilt = 50; and so on.. and the player rotated in the global coordinates
How can I define the local tilt angle of the player? I need this for an improved camera script, which depends on the tilt of the player.....


a generator of dull questions smile
Page 2 of 2 1 2

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