Author Topic: how to solve the shaking problem?  (Read 6282 times)

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
how to solve the shaking problem?
« on: November 21, 2006, 09:14:07 pm »
I have some objects moving in my 3D game, but when the objects move, the whole screen looks a little bit shaking, which is not acceptable. Could I adjust some parameters in the Config or World or Camera to solve such a problem?

thanks.

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
how to solve the shaking problem?
« Reply #1 on: November 21, 2006, 10:22:30 pm »
That is interesting.
I have no idea what you are referring to, but I do recall
this happening if your backbuffer isnt used properly.

When superimposing sprites onto the map, changes to the positions of
them were done, and you end up with things shaking as the positions
of some where altered before the redraw, and some missed it and were left behind by a pixel or to.

I would imagine you are speaking of a different phenomenon, but
I thought id mention this:)
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
how to solve the shaking problem?
« Reply #2 on: November 22, 2006, 12:30:48 am »
Hard to tell what you are experiencing here and what do you mean with "shaking"? Are you by any chance manipulating objects and/or the world from another thread than the rendering takes places in when moving?

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
how to solve the shaking problem?
« Reply #3 on: November 22, 2006, 01:00:45 am »
That is exactly what I meant:P
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
yes, a thread controls the objects' movement
« Reply #4 on: November 22, 2006, 04:00:37 pm »
A thread reads position data from database, and move the objects to the position. The problem is when the objects move to the specified position, the objects keep on shaking. That means the movement is not smooth as excepted.
Any body can give me some tips about this question?

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
how to solve the shaking problem?
« Reply #5 on: November 22, 2006, 05:21:45 pm »
I might not grasp what you are saying, but it looks like what me and egon just said:).

If you manipulate the positions of them in one thread, and it isnt synchronised with the thread that does the painting, you end up with shaking.
Its hard to explain.

You NEED to translate the objects, THEN paint.

If i dont understand you still, my bad:P
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
how to solve the shaking problem?
« Reply #6 on: November 22, 2006, 05:22:31 pm »
I think that your thread are always moving the object, maybe validating the last position with the one obtained from the database!

If you are doing so then the problem may be the precition, for example you store 2.34, 3.5678, 2.564 on you database but you get 2.34, 3.57, 2.56 then there will be a small difference between the saved and the loaded data, that may make your object to move small distances on each iteration!
Nada por ahora

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
I found the reason, but don't know how to solve it.
« Reply #7 on: November 22, 2006, 10:25:08 pm »
Thanks for your reply.
It is because the defferent speed of every object.
for example:
     due to the different speed, the distances between the leading object and other objects are changing per 10 ms, and my camera is always looking at the leading object, so from this camera's view, the other objects are shaking,  for example, the first 10 ms, object 2 is behind 3 pix to the leading one, after 10 ms, object 2 is behind 5 pix to the leading, and maybe after another 10ms, object 2 is behind 1 pix to the leading.  I make the camera focus on the leading one, so it seems that the object 2 keep on shaking.

But I don't figure out how to solve this.

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
I fixed the problem.
« Reply #8 on: November 23, 2006, 04:40:39 pm »
after I change the speed, make sure every step is small enough, the shaking problem is solved.
thanks.