Concerning to some commands in PB!

Just starting out? Need help? Post your questions and find answers here.
RealUser60
User
User
Posts: 14
Joined: Sat Jan 06, 2018 4:54 am
Location: Saint George, Utah
Contact:

Concerning to some commands in PB!

Post by RealUser60 »

I've just typed in the code that is listed in the PB Book, & did a program check, & during the check I did noticed a certain command that not include within PB, I also include the code to clarify this problem,

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

Here's the comment,
[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?
forumuser
User
User
Posts: 98
Joined: Wed Apr 18, 2018 8:24 am

Re: Concerning to some commands in PB!

Post by forumuser »

Probably CameraLookAt() was meant?
wombats
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Dec 29, 2011 5:03 pm

Re: Concerning to some commands in PB!

Post by wombats »

User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Concerning to some commands in PB!

Post by J. Baker »

Having the same issue. Some of the 3D commands have changed and they're are not listed in the PureBasic history. CameraLookAt() doesn't work like CameraLocate(). Some material functions don't seem to exist either. Will keep looking.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Concerning to some commands in PB!

Post by J. Baker »

MoveCamera() seems to do what CameraLocate() did. :D
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
Post Reply