2 registered members (SBGuy, AndrewAMD),
1,410
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [camera] Follow an entity
[Re: Polypfreak1987]
#151502
09/01/07 16:28
09/01/07 16:28
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
You may place the camera in a certain distance away from your entity, when you move the entity, move the camera also and keep it always look at your entity. Code:
action yourEntity { while(1) { // entity move code //.....
// Place the camera in a certain distance // away from the entity camera.x = my.x + 15; // play with 15 camera.y = my.y + 15; // play with 15 camera.z = my.z + 2; // play with 2 // Always look at the entity vec_diff(temp,my.x,camera.x); vec_to_angle(camera.pan,temp); wait(1); } }
|
|
|
Re: [camera] Follow an entity
[Re: TSG_Torsten]
#151504
09/01/07 17:24
09/01/07 17:24
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
var key_5_on;
function dontknow { while(1) { if(key_5 == 1 && key_5_on == 1) { run +=1; run %= 2; key_5_on == 0; } if(key_5 == 0) { key_5_on == 1; } if(run == 1) { camera.x = my.x; camera.y = my.y; camera.z = my.z; vec_diff(temp,my.x,camera.x); vec_to_angle(camera.pan,temp); } wait(1); } }
"empty"
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|