Code: Select all
;A Gentle Beginning into 3D
Enumeration
#Mesh
#Tex
#Mat
#Entity_Invader
#Light
#Camera_One
EndEnumeration
;Set the Width, Height, & Bit Depth of the Screen
;Abbreviated variables are used here due to page width constraints :(
Global ScrW.l = 1024
Global ScrH.l = 768
Global ScrD.l = 32
;Other Global variables
Global Quit.b = #False
;Simple error checking procedure
Procedure HandleError(Result.l, Text.s)
If Result = 0
MessageRequester("Error", Text, #PB_MessageRequester_Ok)
End
EndIf
EndProcedure
;Initialize Environment
HandleError(InitEngine3D(), "InitEngine3D() command failed.")
HandleError(InitSprite(), "InitSprite() command failed.")
HandleError(OpenScreen(ScrH, ScrH, ScrD, ""), "Could not open screen.")
HandleError(InitKeyboard(), "InitKeyboard() command failed.")
SetFrameRate(60)
Add3DArchive("Data\", #PB_3DArchive_FileSystem)
HandleError(LoadMesh(#Mesh, "Invader.mesh"), "Can't load mesh")
HandleError(LoadTexture(#Tex, "Invader.png"), "Can't load texture.")
HandleError(CreateMaterial(#Mat, TextureID(#Tex)), "Can't create material")
CreateEntity(#Entity_Invader, MeshID(#Mesh), MaterialID(#Mat))
CreateLight(#Light, RGB(255,255,255),0,5,0)
CreateCamera(#Camera_One,0,0,100,100)
CameraLocate(#Camera_One,0,1,2.5)
RotateCamera(#Camera_One,-15,0,0)
;Main Loop
Repeat
y.l = 2
RotateEntity(#Entity_Invader,0,y,0)
RenderWorld()
FlipBuffers()
ExamineKeyboard()
If KeyboardReleased(#PB_Key_Escape)
Quit = #True
EndIf
Until Quit = #True
End
[15:54:11] [COMPILER] Line 45: CameraLocate() is not a function, array, list, map or macro.
Is there a way to correct this problem? Please help ok?