Hi all,
I played around with the 3d demo in 108 beta 11.
Based on it I tried to load an object created in blender (a simple cube with a texture.
The obj loads and displays fine until the "sync()" in the main loop.
Everything gets covered by the clear color.
rem
rem 3D Lightmapping
rem Artwork by Mark Blosser
rem
rem Init app
SetSyncRate(60,1)
SetClearColor(128,64,0)
rem Loading status
rem Load world
gosub _load_world
rem Setup camera
plrx#=1850 : plrz#=-3650 : plra#=0 : eyeheight#=553
SetCameraPosition(1,plrx#,eyeheight#,plrz#)
SetCameraRotation(1,0,plra#,0)
rem Start loop
rem Main loop
do
`
rem Old position
oldx#=GetCameraX(1)
oldy#=GetCameraY(1)-25.0
oldz#=GetCameraZ(1)
rem Move camera
if GetRawKeyState(38)=1 then MoveCameraLocalZ(1,4.0)
if GetRawKeyState(40)=1 then MoveCameraLocalZ(1,-4.0)
if GetRawKeyState(37)=1 then RotateCameraLocalY(1,-4.0)
if GetRawKeyState(39)=1 then RotateCameraLocalY(1,4.0)
`
rem Gravity on camera
MoveCameraLocalY(1,-0.95)
`
rem New position
newx#=GetCameraX(1)
newy#=GetCameraY(1)-45.0
newz#=GetCameraZ(1)
`
rem Adjust Y to match floor
if ObjectSphereSlide(0,oldx#,oldy#,oldz#,newx#,newy#,newz#,19.0)>0
newx#=GetObjectRayCastSlideX(0)
newy#=GetObjectRayCastSlideY(0)
newz#=GetObjectRayCastSlideZ(0)
SetCameraPosition(1,newx#,newy#+45.0,newz#)
endif
`
rem Framerate prompt
fps=ScreenFPS() : Print(fps)
`
rem Update screen
// things get funky here
Sync()
loop
_load_world:
`
rem Shaders
shaderindex=1 : LoadShader(shaderindex,"vertex.vs","pixel.ps")
`
rem Load lightmaps
dim lm[10]
lm[0]=LoadImage("0.png")
lm[1]=LoadImage("1.png")
for t=0 to 1
SetImageWrapU(lm[t],1)
SetImageWrapV(lm[t],1)
next t
`
rem Load all OBJ making up world (created in FPS Creator)
LoadObject(1,"wuerfel.obj",0)
teximg=LoadImage("wuerfel.png")
SetImageWrapU(teximg,1)
SetImageWrapV(teximg,1)
SetObjectImage(1,teximg,0)
SetObjectImage(1,lm[0],1)
SetObjectShader(1,shaderindex)
SetObjectScale(1,0.1,0.1,0.1)
// Everything works fine here, object is rendered to the screen
Sync()
`
return
I looked at it for some hours and can't find the cause.
Is there any beta documentation yet esp. on the 3d topic?
Any advise would be greatly appreciated!
Cheers,
Jan