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
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Camera rotation #123208
04/11/07 22:53
04/11/07 22:53
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
First sorry for my english;)
How to create 3rd camera but... not changing pan to roll? It means... if you have f.e. a plane and move plane's nose up(tilt), the camera.pan is changing to roll. And if the plane is in vertical position, you can't turn (pan)to wing because camera only roll around one point.
This is a part of my code:

var camera_dist[3] = 25,0,-6; (straight behind & a little up)
- dummy entity(always front to the player, invisible, moving by mouse pointer)
while(1)
{
temp.x = MOUSE_POS.x;
temp.y = MOUSE_POS.y;
temp.z = 200;
vec_for_screen(temp,CAMERA);
vec_set(my.x, temp);
wait(1);
}

- player's ship (spaceship turning to the dummy entity, looking at him)
while(1)
{
vec_set(temp,glupek.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
wait(1);
}

- camera (always behind the player with a little delay)
while(1)
{
if(player != null)
{
CAMERA.pan += 0.1 * ang(player.pan-CAMERA.pan);
CAMERA.tilt += 0.1 * ang(player.tilt-CAMERA.tilt);
vec_set(temp,camera_dist);
Vec_rotate(temp,player.PAN);
CAMERA.X += 0.3*(player.X - temp.X - CAMERA.X);
CAMERA.Y += 0.3*(player.Y - temp.Y - CAMERA.Y);
CAMERA.Z += 0.3*(player.Z - temp.Z - CAMERA.Z);
}
wait(1);
}
I want to have always "full" 180 degree pan, no matter what the tilt is. And I know, that on the oposite side of sphere I will fly on by beck, but that the point. I want f.e. fly on my beck or 45 degree and still pan should be a pan not roll.
I hope You understand what I mean and I'll be waiting for reply.
Tom

Last edited by tompo; 04/11/07 23:55.

Never say never.
Re: Camera rotation [Re: tompo] #123209
04/12/07 08:01
04/12/07 08:01
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline
Member
DerLateinProfi  Offline
Member

Joined: Apr 2006
Posts: 160
Is there an error? Or what do you want? I dont understand. sorry.
You have built a flight simulator, right? and you want that the player can look arund, but only 180? right?


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Camera rotation [Re: tompo] #123210
04/12/07 09:18
04/12/07 09:18
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
NO... there is no bug.. everything works ok but....
I want to make a spaceship shooter:)
Just create yourself simple entity with 3rd camera and you'll see what I mean.
When the ship is in horizontal position everything is ok, it pan around full 180 degree (the ship). Nose "creates" full lenght circle with full radius.
But more f.e. nose up, then it's not full 180pan anymore, but the ship "makes" a thorus. (the circle has lower radius)
And finaly in vertical position pan turns to roll. (radius of this imagin circle is 0).
I want to have always a full spaceship pan.
Maybe it's a different between vec_rotate (world coordinates) and ang_add or Ang_rotate... I don't know.


Never say never.
Re: Camera rotation [Re: tompo] #123211
04/12/07 09:50
04/12/07 09:50
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline
Member
DerLateinProfi  Offline
Member

Joined: Apr 2006
Posts: 160
Are you German or why you've written sorry for my english?? If so you can write german!^^

So I think I know your problem, but i dont understand it to 100%. You fligh with your [censored] horizontal. Than you can look around.(right?) And when you fligh vertical, than you cant look full 180?? Right? I would make it so that you always look straight on, so your camera pan is like the pan of the entity. Or you try to make it that your player is sitting in the ship, so that you can look around the player, and the ship flys with the player as a... BOX around him!


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: Camera rotation [Re: DerLateinProfi] #123212
04/12/07 10:21
04/12/07 10:21
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)

I'm from Poland und ich spreche deutch nicht;)
Forgot the player... ship is the player.
I don't wanna pan camera aroud the ship... no.
I want to turn the ship, and pan should be always pan (left is left, right is right) not changing to roll, when the ship is in vertical position (and camera is always behind the engine).


Never say never.
Re: Camera rotation [Re: tompo] #123213
04/12/07 10:24
04/12/07 10:24
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline
Member
DerLateinProfi  Offline
Member

Joined: Apr 2006
Posts: 160
You want to control your ship with the mouse?


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: Camera rotation [Re: DerLateinProfi] #123214
04/12/07 10:46
04/12/07 10:46
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
Yah! That's right.
Just create simple romm with camera and You will see what I mean;)
When you look forward pan.camera (or ship) is pan, but when you look a more up, then less is radius of pan. And if You look straight up, then camera roll.
I want always pan the ship (turn by wing) and camera is behind that ship, and lokks at him.


Never say never.
Re: Camera rotation [Re: tompo] #123215
04/12/07 10:55
04/12/07 10:55
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline
Member
DerLateinProfi  Offline
Member

Joined: Apr 2006
Posts: 160
Yes it's like a Ball wich is around the player, but I'm realy sorry I don't know how to change it. Ask farther on. Sorry man. i think Thunder will help you! I hope that anyone can help you. SORRY again.


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu
Re: Camera rotation [Re: DerLateinProfi] #123216
04/12/07 11:26
04/12/07 11:26
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Try c_rotate with mode "USE_AXISR".

Re: Camera rotation [Re: vlau] #123217
04/12/07 11:34
04/12/07 11:34
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
I've been... and the same:( Roll in vertical position:(

Example:
while(1)
{
mouse_hor = (pointer.x - ((screen_size.x )/2));
mouse_ver = (pointer.y - ((screen_size.y )/2));
c_rotate (me, vector(mouse_hor,mouse_ver,0), IGNORE_YOU);
wait(1);
}


Never say never.
Page 1 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