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
0 registered members (), 631 guests, and 2 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 3 1 2 3
cameras and mouse movement #129256
05/10/07 15:57
05/10/07 15:57
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
hi i need a bit of an idea on what kind of camera function would use just the cursor, i tried an fps camera but that view also moves my mesh, i need the mesh to stay still but the camera to be able to move around, so i can click on crewmen to give orders. which kind of camera should i use for this?
thanks in advance for all advice.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: cameras and mouse movement [Re: jigalypuff] #129257
05/10/07 16:10
05/10/07 16:10
Joined: Oct 2003
Posts: 702
Z
zazang Offline
User
zazang  Offline
User
Z

Joined: Oct 2003
Posts: 702
maybe a 3rd person view would give a good view of crewmen,but the mesh may move..so you have to add a little code to avoid player mesh movement when cursor
is visible.


I like good 'views' because they have no 'strings' attached..
Re: cameras and mouse movement [Re: zazang] #129258
05/10/07 16:14
05/10/07 16:14
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
thanks i`ll look through the aums to see if there`s an example of this sort of thing.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: cameras and mouse movement [Re: jigalypuff] #129259
05/10/07 16:32
05/10/07 16:32
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
??
sry, maybe I'm just ... kinda slow right now... but what do you mean the mesh moves?
when your cam moves, then the cam moves, when the mesh moves, the mesh moves, but the cam doesn't move the mesh...!?

or do you mean that the camera needs to be able to rotate without the mesh rotating as well, and your fps is connected to it?
if yes, try this code (3rd person cam, that rotates around the player... without the player turning is this what you need?)
Code:


var cam_rotation[3];

function third_person_cam()
{
var cam_vec[3];
while(1)
{
vec_set(cam_vec,vector(-1000,0,10);
cam_rotation.pan = ang(cam_rotation.pan + mouse_force.x*time_step*5);
vec_set(temp,cam_rotation);
vec_add(temp,player.pan);
vec_rotate(cam_vec,temp);
vec_add(cam_vec,player.x);
vec_set(camera.x,cam_vec);
vec_diff(temp,player.x,camera.x);
vec_to_angle(camera.pan,temp);
wait(1);
}
}


action player_action
{
third_person_cam();
...
]




not tested, hope it works


~"I never let school interfere with my education"~
-Mark Twain
Re: cameras and mouse movement [Re: Germanunkol] #129260
05/10/07 16:42
05/10/07 16:42
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
let me try to explain again, i know i`m a bit of a dunce at getting across what i mean
basicly i want the model to stay still and for the mouse to control the camera.
here`s the basic idea
i have this mesh

when i press 2 the camera switchs from isometric view to fps view which is this

i need the bridge to not be affected by the camera movement, eventually i`ll add crewmen and they will respond to orders which will pop up when you click on them. so i want the mouse to pan the camera so i can click on the crew. hope thats a better explanation. and thanks.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: cameras and mouse movement [Re: jigalypuff] #129261
05/10/07 17:00
05/10/07 17:00
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Quote:

i tried an fps camera but that view also moves my mesh


Just change the code so it does not move your mesh

Re: cameras and mouse movement [Re: Claus_N] #129262
05/10/07 17:37
05/10/07 17:37
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
a good idea claus, but i`m jiggered if i can see what i have to change lol. i`ll post the camera code and hope you`ll show me whats wrong.
Code:

if (camera_number == 2)
{
camera.x = player.x -40;
camera.y = player.y - 0;
camera.z = player.z + 0;
camera.pan = player.pan;
camera.tilt = 0;
}


thats the first person cam code, and thanks again for the help.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: cameras and mouse movement [Re: jigalypuff] #129263
05/10/07 17:49
05/10/07 17:49
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Could you please post the code for turning the camera also?

Re: cameras and mouse movement [Re: Claus_N] #129264
05/10/07 18:09
05/10/07 18:09
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
heck, i think i see the problem, the code which turns the camera is the same as the code which turns the ship in isometric mode, does this mean i need to change everything?
Code:

function c_ship
{
player = my;
my.scale_x = 2.0;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
var ship_speed;
while (1)
{
if (key_w == on)
{
if (ship_speed.x < 1)
{
ship_speed.x += 1.3 * time;
}
}
else
{
if (ship_speed.x >= 0)
{
ship_speed.x -= 0.05 * time;
}
}
if (ship_speed.x < 0) {ship_speed.x = 0;}
if (key_a == on)
{
my.pan += 3 * time;
my.roll - = 3 * time;
}
if (key_d == on)
{
my.pan -= 3 * time;
my.roll + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_q == on)
{
my.tilt + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_e == on)
{
my.tilt - = 3 * time;
}
ent_move (ship_speed.x, nullvector);
ship_camera();
wait (1);

}
}




Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: cameras and mouse movement [Re: jigalypuff] #129265
05/10/07 18:16
05/10/07 18:16
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Well, you do need some changes

I did this very fast, so it might need something
Code:
function c_ship
{
player = my;
my.scale_x = 2.0;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
var ship_speed;
while (1)
{
if(camera_number != 2)
{

if (key_w == on)
{
if (ship_speed.x < 1)
{
ship_speed.x += 1.3 * time;
}
}
else
{
if (ship_speed.x >= 0)
{
ship_speed.x -= 0.05 * time;
}
}
if (ship_speed.x < 0) {ship_speed.x = 0;}
if (key_a == on)
{
my.pan += 3 * time;
my.roll - = 3 * time;
}
if (key_d == on)
{
my.pan -= 3 * time;
my.roll + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_q == on)
{
my.tilt + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_e == on)
{
my.tilt - = 3 * time;
}
ent_move (ship_speed.x, nullvector);
ship_camera();
wait (1);
}
else
{
// FPS camera code here
if(key_a)
{
camera.pan += 3 * time;
}
if(key_d)
{
camera.pan -= 3 * time;
}
}

}
}



EDIT: Remember to delete/comment out the camera.pan = player.pan; line!

Last edited by Claus_N; 05/10/07 18:17.
Page 1 of 3 1 2 3

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