Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,618 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Panel.pos_x/pos_y with var precision #179791
01/24/08 19:59
01/24/08 19:59
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Well, I move some panels very slowly with an effective speed of <1 pixellength per frame. Though, it seems, all panels are snapped on integers. The panel's motion is stuttering all the time and I can only circumvent it, when I set a low fps_max (=30) and move them with integer values without time correction via time_step to make it move smoothly. Entity panels are no option, since my panels move between other panel-layers, too.

Here is some sample code:

Code:
PANEL* pan;
pan = ...;

pan->pos_y += 0.1 + sin(total_ticks) * 0.1 * time_step;
pan->pos_x += sin(total_ticks) * 0.5 * time_step;



Can you please circumwent this by giving panels var precision?

Cheers, Christian

Last edited by HeelX; 01/24/08 20:00.
Re: Panel.pos_x/pos_y with var precision [Re: HeelX] #179792
01/25/08 09:37
01/25/08 09:37
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
I'll check if this is possible. However, a solution for the stuttering problem is precalculating the frames per pixel, rounding it to the next integer N, and moving the panel by one pixel every Nth frame.

Re: Panel.pos_x/pos_y with var precision [Re: jcl] #179793
01/25/08 12:36
01/25/08 12:36
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Honestly, I do not get what you are driving at. The motion is in my example associated with a sin wave and the time_step value, which is not static if I do not limit the fps_max. Do you mean, that I take the position of my panel and add motion only to a second "position". When the position is 1 pixel or more related to the original panel, I move the panel?

Hm, I will check it out. Thanks, that you will check it on your side, too

Cheers
Christian

Re: Panel.pos_x/pos_y with var precision [Re: HeelX] #179794
01/25/08 13:04
01/25/08 13:04
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
No, my suggestion would not work with a sine wave motion, only with a straight motion. I am not sure if DirectX allows to blend 2D objects between pixels at all, without going to 3D. But I've put this on my list of things to check.

Re: Panel.pos_x/pos_y with var precision [Re: jcl] #179795
01/26/08 02:09
01/26/08 02:09
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
I have no problem at all with panel movements... is that just me?


Click and join the 3dgs irc community!
Room: #3dgs
Re: Panel.pos_x/pos_y with var precision [Re: Joozey] #179796
01/26/08 08:45
01/26/08 08:45
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Try to use my code. When the panel coordinates allow only integer's and you move them very gently, they "snap" all the time, because you cannot pose them on 3.5 or 6.03 or that kind of stuff.

Re: Panel.pos_x/pos_y with var precision [Re: HeelX] #179797
01/26/08 16:14
01/26/08 16:14
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Ah like that. Never noticed it all that much, but it would be nice if directX supports it .


Click and join the 3dgs irc community!
Room: #3dgs
Re: Panel.pos_x/pos_y with var precision [Re: jcl] #205056
05/03/08 14:18
05/03/08 14:18
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
 Originally Posted By: jcl
No, my suggestion would not work with a sine wave motion, only with a straight motion. I am not sure if DirectX allows to blend 2D objects between pixels at all, without going to 3D. But I've put this on my list of things to check.


Did you checked this? If this doesn't work I will work out a custom solution for this.

Re: Panel.pos_x/pos_y with var precision [Re: HeelX] #205068
05/03/08 15:52
05/03/08 15:52
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Happy Birthday Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
do the calculation with floats and then always set the panels coordinates to that floats. I know that it will interrupt your workflow a bit, but that would be a workaround for now.

Re: Panel.pos_x/pos_y with var precision [Re: Scorpion] #205070
05/03/08 16:03
05/03/08 16:03
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I do that already \:\) But the representaion is not suited for floating point values.

Page 1 of 2 1 2

Moderated by  aztec, Spirit 

Gamestudio download | 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