Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Trouble with Sync?

Author
Message
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 28th Dec 2002 22:16
Has anyone had trouble with the sync command?

Like; if you need to reposition an object and then hide it, the object flickers when it shouldn't show up at all?

Or; if you are using the camera command the sync overcompensates the camera in one frame and then corrects it in the next?

Or; I have hidden objects way at the begininning of the program and they flicker... of course I think this might have something to do with the eight .x files being over one Meg?

I am wondering if their is any concern using the sync command?
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Dec 2002 22:23
Are you using the 'sync on' command at the top of your program? Can you post a minimal example?
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 28th Dec 2002 23:39
Rem Project: earther
Rem Created: 12/26/02 4:59:39 AM
Rem Created BY: Greg Boyarzin/ICERGB
Rem
sync on
Rem ***** Main Source File *****
color backdrop rgb(0,0,0)

load object "burst1.x",1

load object "burst4.x",2
scale object 2,99,99,99
hide object 2
load object "burst6.x",3
scale object 3,96,96,96
hide object 3
load object "burst8.x",4
scale object 4,90,90,90
hide object 4
load object "burst10.x",5
scale object 5,83,83,83
hide object 5
load object "burst12.x",6
scale object 6,74,74,74
hide object 6
load object "burst14.x",7
scale object 7,64,64,64
hide object 7
load object "burst16.x",8
scale object 8,55,55,55
hide object 8
load object "burst17.x",9
ghost object on 9
scale object 9,50,50,50
hide object 9
load object "blit17.x",10
scale object 10,50,50,50

load object "blit17.x",12
scale object 12,50,50,50

make object sphere 11,1
color object 11,rgb(255,0,0)
autocam off


zbarf=45
for i=1 to 10
turn object left i,zbarf
next i
turn object left 12,zbarf
b=zbarf
pitch object down 12,180



move camera -20


cx=camera position x()
cy=camera position y()
cz=camera position z()
position object 11,cx,cy,cz


rem the HIDE OBJECT problem
REM OBJECT 11 AND 12 ARE HIDDEN THEY SHOULD NOT SHOW UP UNTIL
REM AFTER THE REPEAT
hide object 11
hide object 12
set cursor 0,0
print "Press a key"
set cursor 0,20
print "notice that the white square moves on the right, it should be hidden."


remstart
rem The following should not be necessary because
rem it was dealt with using the position object 11,cx,cy,cz
rem above
ox=object position x(11)
oy=object position y(11)
oz=object position z(11)
position camera 0,ox,oy,oz
remend

sync




wait key


for a=1 to 9
rem inc a
b=b+5

show object a
turn object left a,b
if a=9
set cursor 1,1
print "before finished, the white square on right should not be there"
sync
wait key
endif


gosub domove

if a<>9 then hide object a
d=d+b


next a




turn object left 10,d
turn object left 12,d
show object 12
show object 11

wait key


end











domove:




move object 11,1

ox=object position x(11)
oy=object position y(11)
oz=object position z(11)


position camera 0,ox,oy,oz

sync
t=timer()
repeat
until timer()=t+500

return
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Dec 2002 23:48
Move the 'autocam off' to just after the 'sync on' command. Let us know how you get on.
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 29th Dec 2002 03:24
I am trying to get the 3d files uploaded to my server...
Will get back when I have a link.

There is almost no twisting effect at all when you replace the .x objects with primitives...

This in itself is puzzling...
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 29th Dec 2002 07:25
Here is the link...

http://www.boyar.net/fixme.zip
2.9Meg

I would encourage trial and error with this format because it seems to "placate" alot of bugs...

It will make everything easier in the long run if we can narrow down these nasties!


Also;
Here is more trouble...

-------------------------
Rem Project: earther
Rem Created: 12/26/02 4:59:39 AM
sync on
Rem ***** Main Source File *****

load object "burst1.x",1

load object "burst4.x",2
scale object 2,99,99,99
hide object 2
load object "burst6.x",3
scale object 3,96,96,96
hide object 3
load object "burst8.x",4
scale object 4,90,90,90
hide object 4
load object "burst10.x",5
scale object 5,83,83,83
hide object 5
load object "burst12.x",6
scale object 6,74,74,74
hide object 6
load object "burst14.x",7
scale object 7,64,64,64
hide object 7
load object "burst16.x",8
scale object 8,55,55,55
hide object 8
load object "burst17.x",9
ghost object on 9
scale object 9,50,50,50
hide object 9

rem take the next two rems out
rem because I add this other object; the whole thing snuffs itself out!
rem why?
rem load object "blit17.x",10
rem scale object 10,50,50,50

do



for i=1 to 9
show object i



for f=1 to 9
inc ch

yrotate object i,wrapvalue(ch)
rem take the next rem out
rem yrotate object 10,wrapvalue(ch)
t=timer()

repeat
until timer()=t+10
sync

next f
f=0



hide object i
if inkey$()="q" then end
next i
loop
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Dec 2002 12:51
I didn't get the problem of objects appearing as they loaded.

I did get a problem when they were displayed though. It looked as if vertical bands in the model were getting narrower, and then finally the program froze.

Because I'm no expert in 3D, I'm afraid I can do no more than say that hopefully patch 4 should fix it, while cowering and covering my ears.
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 29th Dec 2002 14:23
Yes the vertical bands were getting smaller because it is 9 different .x files of a sphere bursting outward... But each burst is treated like a 3d image...
It would be harrowing knowing that alot of these commands will be fixed in the next DBPro version...
Fix it NOW!!! Before it is to late!!!
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 29th Dec 2002 16:03
i've not downloaded yet to try but
try a fastsync instead of sync... then add a sync at the end of the loop

Anata aru kowagaru no watashi!
Viktor
21
Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 29th Dec 2002 18:16
I noticed that SYNC does not work correctly (means: does not update the screen) after SYNC ON, but I tested this only with 2D commands.

PC: AMD 1200/512 Mb SDR/GF2MX Dual Display/Win2000, 19" Monitor
ZX: Spectrum 128+ Customized version.
Current Project: BMP2SCR Pro (with LDIR)
haggisman
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 29th Dec 2002 18:19
code?

Specs:- 1GHZ athlon, Radeon8500, 192mb ram, winxp
Terabyte
21
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 30th Dec 2002 16:46
I think i know what you mean
I found that the problem was that when i used sync on and sync rate 60 that you din't need to have sync in the loop
!"£$%^&??????

ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 31st Dec 2002 09:35
If I can find a work around it doesn't really bother me

fastsync doesn't seem to want to work either...

Login to post a reply

Server time is: 2024-05-17 07:22:14
Your offset time is: 2024-05-17 07:22:14