Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,418 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Free Camera Mode? #88577
09/03/06 10:39
09/03/06 10:39
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Hi there,

Is there a way to use free camera mode in 3DGS? I want to use it in a simulation. The user must pressing a key to switch the views.

Thanks in advance for the answer.

Re: Free Camera Mode? [Re: Polypfreak1987] #88578
09/03/06 11:18
09/03/06 11:18
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Code:

function free_cam()
{
player = my;
my.invisible = off;
var fly_speed;
var fly_turn_speed = 12;
vec_set (camera.x, my.x);
vec_set (camera.pan, my.pan);
while(my)
{
if (key_shift) { fly_speed = 44; }
else { fly_speed = 32; }

vec_set (temp, nullvector);
temp.x = (mouse_left - mouse_right) * fly_speed * time_step;
camera.pan -= fly_turn_speed * mouse_force.x * time_step;
camera.pan = camera.pan%360;
camera.tilt += fly_turn_speed * mouse_force.y * time_step;
camera.tilt = clamp(camera.tilt, -90, 90); //limit
camera.roll = 0;
vec_rotate (temp, camera.pan);
vec_add (camera.x, temp);
wait(1);
}
}




My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Free Camera Mode? [Re: Orange Brat] #88579
09/03/06 15:19
09/03/06 15:19
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
I got an error when I'm using this code:

Quote:

Empty Pointer in free_cam: my.invisible = off;




Re: Free Camera Mode? [Re: Polypfreak1987] #88580
09/03/06 15:27
09/03/06 15:27
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
function must be assigned to simple model, existed in level (small cube, for example): ent_create(.....,free_cam)
or make it action and assign in WED
EDIT:
to switch between cameras on key pressed take that code as snippet and integrate it in your camera code

Last edited by Lion_Ts; 09/03/06 15:30.
Re: Free Camera Mode? [Re: Lion_Ts] #88581
09/03/06 15:53
09/03/06 15:53
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Ok, thanks.

But is it possible to modify the code so, that you have 1 point of view? So that you don't have to "walk" to the point that you want to see.

Thanks in advance.

Re: Free Camera Mode? [Re: Polypfreak1987] #88582
09/03/06 21:50
09/03/06 21:50
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
set position of invisible entity at function start:
Code:

function free_cam(){
vec_set(my.x, player.x);
player = my;
my.invisible = off;
...


and I recommend again, use that code as a snippet to modify your code. You have to understand what is going on inside your code, don't just 'copypaste' Orange Brat's code.


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