Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
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
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 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
Can you correct this script #275455
07/01/09 12:25
07/01/09 12:25
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
I'm trying to make FPS camera. The code works, but there are 2 annoying bugs in it:
1) The camera constantly glides over the terrain and can't stop.
2) I can't set tha camera's height in relation to the terrain.

Here is the code:

action free_camera
{
my.invisible = on;

while (1)
{
my.pan -= 10 * mouse_force.x * time_step;
my.tilt += 10 * mouse_force.y * time_step;

c_move(my,vector ((key_w-key_s)*30*time_step,(key_a-key_d)*30*time_step,0),nullvector,GLIDE);

c_move(me,vector(0,0,-10),NULLVECTOR,GLIDE); //my simple code for gravity

vec_set(camera.x, my.x);
vec_set(camera.pan,my.pan);
wait(1);



}
}

Last edited by mEnTaL; 07/01/09 12:31.
Re: Can you correct this script [Re: mEnTaL] #275598
07/01/09 23:14
07/01/09 23:14
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
prevent gliding:
replace: c_move(me,vector(0,0,-10),NULLVECTOR,GLIDE); //my simple code for gravity
by: c_trace(my.z, vector(my.x, my.y, my.z+100), IGNORE_ME | IGNORE_PASSABLE | USE_BOX);
my.z = target.z;

height:
vec_set(camera.x, my.x); //set to ground
camera.z += 50; //add 50 quants upwards



Last edited by Joozey; 07/01/09 23:15.

Click and join the 3dgs irc community!
Room: #3dgs
Re: Can you correct this script [Re: Joozey] #275777
07/02/09 11:08
07/02/09 11:08
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
hmm I tried it, but the camera gets stuck in the terrain and hardly moves.

Re: Can you correct this script [Re: mEnTaL] #275783
07/02/09 11:20
07/02/09 11:20
Joined: Aug 2005
Posts: 512
Bayern
Schmerzmittel Offline
User
Schmerzmittel  Offline
User

Joined: Aug 2005
Posts: 512
Bayern
What Version do you have.

I had the same problem with an older A6 Engine.


A7 Com V7.80
Re: Can you correct this script [Re: Schmerzmittel] #275802
07/02/09 12:40
07/02/09 12:40
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
I'm with A7

Re: Can you correct this script [Re: mEnTaL] #275909
07/02/09 18:02
07/02/09 18:02
Joined: Aug 2005
Posts: 512
Bayern
Schmerzmittel Offline
User
Schmerzmittel  Offline
User

Joined: Aug 2005
Posts: 512
Bayern
I mean what versionnumber? Look in SED under About.


A7 Com V7.80
Re: Can you correct this script [Re: Schmerzmittel] #275920
07/02/09 19:06
07/02/09 19:06
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
version 7.02.4


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