Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (Akow), 1,361 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Take away the dancing to a camera #398309
03/30/12 22:57
03/30/12 22:57
Joined: Nov 2009
Posts: 22
spain
J
jumpu Offline OP
Newbie
jumpu  Offline OP
Newbie
J

Joined: Nov 2009
Posts: 22
spain
I'm trying to move a camera along a path with this action:

action camera_path()
{
// create a dummy path entity
//me = ent_create(NULL,nullvector,NULL);
path_set(me,"path_000");
var dist = 0;
var vLastPos[3];
var vDir[3];
while(1)
{
// place the camera on the path
path_spline(me,camera.x,dist);
dist += 5*time_step;
// let the camera look ahead
vec_diff(vDir,camera.x,vLastPos);
vec_to_angle(camera.pan,vDir);
vec_set(vLastPos,camera.x);
wait(1);
}
}

But the camera has a shimmy if it moves in slow motion
dist += time_step;
if done at high speed is not noticeable
dist += 5*time_step;
How I can do to keep dancing the camera in slow motion?
Thank you.

Re: Take away the dancing to a camera [Re: jumpu] #398316
03/31/12 08:22
03/31/12 08:22
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi Jumpu,

the main problem is that when you transform the movement to an angle vector, it is so small that the vector transforming maths sightly fails and each step gives you a shimmy orientation.

You can retrieve a bit further point into the spline to avoid this problem.

------------------------------------
Aupa Jumpu,

El problema reside en que el vector de desplazamiento es tan pequeño que al transformarlo en un vector angular, los cáculos que realiza no son lo suficientemente precisos y resultan en ese zigzagueo que comentas.

Puedes evitarlo utilizando un punto más alejado dentro del spline en vez de utilizar la posición anterior.

algo así:
Code:
action camera_path()
{
   // create a dummy path entity
   //me = ent_create(NULL,nullvector,NULL);
   path_set(me,"path_000");
   var dist = 0;
   var vLastPos[3];
   var vDir[3];
   while(1)
   {
      // place the camera on the path
      dist += 5*time_step;
      path_spline(me,camera.x,dist);
      
      // let the camera look ahead
      path_spline(me,vLastPos,maxv(dist-1,0)); // 1 o más...
      vec_diff(vDir,camera.x,vLastPos);
      vec_to_angle(camera.pan,vDir);
      //vec_set(vLastPos,camera.x);
      wait(1);
   }
}



Salud!


Re: Take away the dancing to a camera [Re: txesmi] #398319
03/31/12 09:43
03/31/12 09:43
Joined: Nov 2009
Posts: 22
spain
J
jumpu Offline OP
Newbie
jumpu  Offline OP
Newbie
J

Joined: Nov 2009
Posts: 22
spain
Hello Txesmi that joy back in touch with you.
The recommendation to give me, not solve the problem, as the flicker persists.
En tu correo personal te envio unos links, del programa en el que tengo el problema, y otro de un salvapantallas netamente gallego, que creo me quedo bastante bien, (dame tu opinion, ¡si quieres!).
Hecho tanto de menos "partidabierta" que el volver a conectar contigo me
recuerda aquellos tiempos en los que cuando tenias un problema tenias
a quien preguntar y te entendia. (los que hablan en ingles, no me entienden,
o yo no se esplicarme en ingles).
Un abrazo.

Last edited by jumpu; 03/31/12 10:14.
Re: Take away the dancing to a camera [Re: jumpu] #398323
03/31/12 10:53
03/31/12 10:53
Joined: Nov 2009
Posts: 22
spain
J
jumpu Offline OP
Newbie
jumpu  Offline OP
Newbie
J

Joined: Nov 2009
Posts: 22
spain
Txesmi already: I am a fast, as you said, 1 or more
path_spline (me, vLastPos, MaxV (dist-1, 0)) / / 1 or more ...

I did my set and followed with minus 1, I put -5, and now the shift is smooth.
Thank you very much.

Re: Take away the dancing to a camera [Re: jumpu] #398324
03/31/12 11:04
03/31/12 11:04
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
The pleasure is mine smile

ok, I see the problem. The unit subtratcted to the distance is also too small to solve the problem.

I changed it to 10 and it works good. Some other problems appear at the beginning but they are very easy to solve, just start with a bigger distance value, 10 or so...

------------------------------

Acabo de ver los proyectos que me has mandado. Me has dejado impresionado. ¡Enhorabuena! He echado de menos alguna sombrica en el del orrio, pero bueno, estupendos ambos. La taberna está muy lograda.

La solución del problema está en aumentar la distancia restada a la posición de la cámara. Resulta que restar solamente uno a la variable 'distance' también es muy poco para que los cálculos de transformación sean lo suficientemente contínuos. La solución está en restar algo cercano a 10. Al aumentar la resta, aparecen nuevos problemas al inicio del movimiento, que se solucionan perfectamente al aumentar el valor inicial de la variable 'distance' también a 10. Estos nuevos cálculos quizás te hagan modificar ligeramente los paths para que los giros de la cámara sean contínuos.

La verdad que google translate lo hace fatal y no se puede confiar en que lo que te devuelve como traducción sea inglés de verdad. Es más un apoyo que un traductor al hecho.

Bueno, encantado de poder ayudarte,
Salud!

EDITED
ups, selfsolved is the best!


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