ups, i did read the values in, but i didn't reposition the window.
this one should work now.
just for the record and if anyone is interested here is the full sourcecode:
`viewer
`main.dba
`======================
// read command line arguments
commandline$=cl$()
//set default values
winpos$="0,0"
winsize$="480,320"
// parse arguments
a$=first token$(commandline$," ")
repeat
select a$
case "-p"
winpos$=next token$(" ")
endcase
case "-s"
winsize$=next token$(" ")
endcase
case default
if model$=""
model$=a$
if left$(model$,1)=chr$(0x22)
if right$(model$,1)<>chr$(0x22)
repeat
model$=model$+" "+next token$(" ")
until right$(model$,1)=chr$(0x22)
endif
model$=left$(right$(model$,len(model$)-1),len(model$)-2)
endif
else
texture$=a$
if left$(texture$,1)=chr$(0x22)
if right$(texture$,1)<>chr$(0x22)
repeat
texture$=texture$+" "+next token$(" ")
until right$(texture$,1)=chr$(0x22)
endif
texture$=left$(right$(texture$,len(texture$)-1),len(texture$)-2)
endif
endif
endcase
endselect
a$=next token$(" ")
until a$=""
// set window position and size
set display mode val(first token$(winsize$,",")),val(next token$(",")),32
set window position val(first token$(winpos$,",")),val(next token$(","))
// load model
if file exist(model$)
load object model$,1
print "load object"
endif
// load texture
if file exist(texture$)
load image texture$,1
if object exist(1)
texture object 1,1
endif
endif
//a value for normalizing the scroll value.
scrollW#=(camera position z()/10)*-1
// save camera position for reset
cx#=camera position x()
cy#=camera position y()
cz#=camera position z()
sync rate 60
do
// reset mouse move values. yes, this works.
if mouseclick()=0
mousemovex()=0
mousemovey()=0
endif
// handle controlls
if mouseclick()>0 and mousey()>16
// rotate object
if mouseclick()=1 and controlkey()=0
rotate object 1,object angle x(1)-mousemovey(),object angle y(1)-mousemovex(),0
endif
// reposition view
if mouseclick()=2 or mouseclick()=4
position camera camera position x()-(0.0+mousemovex())/2,camera position y()+(0.0+mousemovey())/2,camera position z()
endif
// scroll
if mouseclick()=1 and controlkey()=1
position camera camera position x(),camera position y(),camera position z()+(0.0+mousemovey())*scrollW#
endif
endif
// reset
if inkey$()="r"
position camera cx#,cy#,cz#
position object 1,0,0,0
rotate object 1,0,0,0
endif
// scroll
position camera camera position x(),camera position y(),camera position z()+mousemovez()/120*scrollW#
mousemovez()=0
loop
// cleanup
if object exist(1)
delete object 1
endif
if image exist(1)
delete image 1
endif