I've been working on a extremely easy to use 3D engine for some time now, named
3D Zone. The engine is distributed as a dll, and works with a lot of Basic flavours.
Now that PlayBasic has been released, I have decided to include support for this new language. Here is the result:
The code used to run the demo shown in the screenshot:
;Device
zDeviceOpen(800, 600, 32, DF_STENCILBUFFER Or DF_DIRECTX Or DF_FULLSCREEN, 0)
zMouseHide(True)
;Ambient light
zSceneAmbient(zGetColor(255, 150, 150, 150))
;Create map
zSceneTexturePath("media/space/")
mesh = zMeshLoad("media/space/space.my3d")
map = zMeshOctreeNode(mesh, 0, 3)
zMeshFree(mesh)
;Create camera
cam = zCameraNode(0)
zNodePosition(cam, 0, 250, -500)
zNodeCollision(cam, map, 48, 256, 48)
font = zFontLoad("media/fonts/courier.bmp")
zMousePosition(zDeviceWidth()/2, zDeviceHeight()/2) : mx = zMouseX() : my = zMouseY()
While zDeviceClosed() = 0 And zKeyHit(KEY_ESCAPE) = 0
mxs = zMouseX() - mx : mys = zMouseY() - my
zMousePosition(zDeviceWidth()/2, zDeviceHeight()/2)
mx = zMouseX() : my = zMouseY()
pitch# = zNodePitch(cam) - mys
If pitch# < -80 Then pitch# = -80
If pitch# > 80 Then pitch# = 80
zNodeRotate(cam, pitch#, zNodeYaw(cam) + mxs, 0)
If zKeyDown(KEY_UP) Then zNodeMove(cam, 0, 0, 6)
If zKeyDown(KEY_DOWN) Then zNodeMove(cam, 0, 0, -6)
If zKeyDown(KEY_LEFT) Then zNodeMove(cam, -6, 0, 0)
If zKeyDown(KEY_RIGHT) Then zNodeMove(cam, 6, 0, 0)
zNodePosition(cam, zNodeX(cam,0), zNodeY(cam,0) - 6, zNodeZ(cam,0))
zSceneBegin 3, 0
zSceneRender(cam)
zSetColor(zGetColor(255,255,255,255))
zDrawText(font, Str$(zDeviceFPS()) + " FPS", 0, 0)
zSceneEnd()
EndWhile
zDeviceClose()
End
I will release this dll, with full documentation, for a really low price.
The estimated release date is mid-july.
== Jedive ==
AthlonXP 1600+, 512MB, GeForce5200, WinXP/DX9, Fedora Core 3
iBook G4 1Ghz, 256MB, Radeon9200, Mac OS X Panther