2 registered members (TipmyPip, AndrewAMD),
12,726
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: how do you create a third person view ?
[Re: paracharlie]
#414657
01/06/13 10:58
01/06/13 10:58
|
Joined: Jul 2001
Posts: 4,801 netherlands
Realspawn

Expert
|

Expert
Joined: Jul 2001
Posts: 4,801
netherlands
|
@paracharlie I don't see the problem here i pointed you to my place were in the basic workshop are many camera views including the one you need. Others also pointed you in the right direction so with a little effort you should have your solution 
|
|
|
Re: how do you create a third person view ?
[Re: paracharlie]
#414667
01/06/13 13:37
01/06/13 13:37
|
Joined: Nov 2012
Posts: 49
amirmehrvarz
OP
Newbie
|
OP
Newbie
Joined: Nov 2012
Posts: 49
|
this is piece of my code (move and rotate ) but There are many problems for example Player get into the walls and floor Mouse go round 360 degrees And when we shoot bullets fired from different places will
/////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////////////////
var c_move_w;
var c_move_s;
///////////////////////////////main function ////////
function main ()
{
level_load ("level1.wmb");
video_mode = 7;
}
///////////////////////////////action myplayer ////////
action myplayer ()
{
while(1)
{
/////////////////////////////////////move
if (key_w == 1)
{
c_move(my,vector(40*time_step,0,0),NULL,GLIDE);
ent_animate(my,"walk",c_move_w,ANM_CYCLE);
c_move_w +=10*time_step;
}
if (key_s == 1)
{
c_move(my,vector(-40*time_step,0,0),NULL,GLIDE);
ent_animate(my,"walk",c_move_s,ANM_CYCLE);
c_move_s +=10*time_step;
}
//////////////////////////////////// pan
my.pan -= mouse_force.x;
my.tilt +=mouse_force.y;
////////////////////////////////////camera following
vec_set(camera.x,vector(-150,30,25)); //////////////third person camera
vec_rotate(camera.x,my.pan);
vec_add(camera.x,my.x);
vec_set(camera.pan,vector(my.pan,-10,0));
vec_set(camera.tilt,vector(my.tilt,0,0));
/////////////////////////////////////////
wait(1);
}
}
Last edited by Realspawn; 01/06/13 17:49.
|
|
|
Re: how do you create a third person view ?
[Re: rayp]
#414698
01/06/13 20:01
01/06/13 20:01
|
Joined: Nov 2012
Posts: 49
amirmehrvarz
OP
Newbie
|
OP
Newbie
Joined: Nov 2012
Posts: 49
|
|
|
|
Re: how do you create a third person view ?
[Re: ratchet]
#414706
01/06/13 21:10
01/06/13 21:10
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Your code overwrites random portions of memory.
vec_set(camera.tilt,vector(my.tilt,0,0));
Do the tutorial. I think you have no clue about the code above and that you have copied it from the AUM. Am I right about this?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|