Hello,
I am trying to understand how multiple viewports work, and I almost got it (I think), I just can't get smooth motion.
What am I doing wrong?, I have a feeling it has something to do with the 'sync' commands, not sure I am using them right. If you run the code you will see that it runs SLOW...
Is there anything obviously or mayorly wrong that any of you guys can see???
Da code:
`Multiple viewports - Test 1
`set variables
PositionStartX=-100
PositionStep=2
` set resolution
set display mode 1024,768,16
Sync on
`sync rate 60
` create matrix, and place at specfic location
make matrix 1,200,200,10,10
position matrix 1,-100,-5,-100
`create cube
make object cube 1,10
`START LOOP
do
`increment position variable
PositionStartX = PositionStartX + PositionStep
`change object's position
position object 1,PositionStartX,0,0
`DRAW VIEWPORTS
`Top Left
Position Camera 3,50,-100
Point Camera Object Position X(1),Object Position y(1),Object Position z(1)
SET CAMERA VIEW 1,1,(Screen Width()/2),(Screen Height()/2)
sync
`Top Right
position camera 3,3,-100
point camera Object Position X(1),Object Position y(1),Object Position z(1)
SET CAMERA VIEW (Screen Width()/2)+1,1, Screen Width(),(Screen Height()/2)
sync
`Bottom Left
position camera -100,3,3
point camera Object Position X(1),Object Position y(1),Object Position z(1)
SET CAMERA VIEW 1,(Screen Height()/2)+1, (Screen Width()/2),Screen Height()
sync
`Bottom Right
position camera 3,-100,3
point camera Object Position X(1),Object Position y(1),Object Position z(1)
SET CAMERA VIEW (Screen width()/2)+1, (Screen Height()/2)+1, Screen Width(),Screen Height()
sync
`if at edge, then reverse direction
if PositionStartX=>100 or PositionStartX