Convert Blitz to PB
Posted: Wed Mar 07, 2007 5:53 am
I scanned the forums for this but saw no direct bit of info... Has anyone ever worked out an easy way to convert Blitz (especially B3D) to PB? 

http://www.purebasic.com
https://www.purebasic.fr/english/
I've done a couple (10 - 15) of conversions manually, but when it comes to some 3D commands - it's a pain in the ***...Rook Zimbabwe wrote:I scanned the forums for this but saw no direct bit of info... Has anyone ever worked out an easy way to convert Blitz (especially B3D) to PB?
Code: Select all
Graphics3D 640,480,0,3
SetBuffer BackBuffer()
mesh = CreateMesh()
surf = CreateSurface(mesh)
v0 = AddVertex (surf, -5,-5,0, 0 ,0)
v1 = AddVertex (surf, 5,-5,0, 1 ,0)
v2 = AddVertex (surf, 0, 5,0, 0.5,1)
tri = AddTriangle (surf,v0,v2,v1)
cam = CreateCamera()
MoveEntity cam, 0,0,-7
RenderWorld
Flip
WaitKey
End
Code: Select all
IncludePath "Include\" : IncludeFile "dreamotion3d.pbi"
Global Quit.b
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
End
EndIf
DM_Graphics3D(640, 480, 32, 0, 1)
*mesh = DM_CreateMesh()
*surf = DM_CreateSurface(*mesh)
v0 = DM_AddVertex (*surf, -5,-5,0, 0 ,0)
v1 = DM_AddVertex (*surf, 5,-5,0, 1 ,0)
v2 = DM_AddVertex (*surf, 0, 5,0, 0.5,1)
tri = DM_AddTriangle (*surf,v0,v2,v1)
*camera = DM_CreateCamera()
DM_MoveEntity(*camera, 0,0,-14)
DM_CameraClsColor(*camera, 125, 125, 125)
Repeat
ExamineKeyboard()
If KeyboardReleased(#PB_Key_Escape)
Quit=1
EndIf
DM_BeginScene()
DM_RenderWorld()
DM_EndScene()
Until Quit=1
DM_ClearGraphics()
End