Pure Basic Having a problem with 3D

Started by Pfaber11, October 16, 2019, 12:11:45

Previous topic - Next topic

Pfaber11

Well this is where I'm at I just can't see where I'm going wrong . It gets stuck at create material saying texture not initialised anybody know what would cause this .
InitEngine3D()
InitKeyboard()

InitSprite()
OpenWindow(0, 0,0,1366,768,"")
OpenWindowedScreen(WindowID(0),0,0,1366,768)

Add3DArchive(#PB_Compiler_Home + "C:/Documents/AGKProjects/fantasy flight simulator/media", #PB_3DArchive_FileSystem)
Debug LoadMesh(1,"paulstree.mesh")
Debug LoadTexture(1,"paulstree.png")

Debug CreateMaterial(1,TextureID(1))
Debug CreateEntity(2, MeshID(1), MaterialID(1),  60, 0, 0)

CreateCamera(0, 50,50, 100,10)

begin:
WindowEvent3D()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Return)
  End
EndIf
RotateCamera(0,10,0,0)
;RotateEntity(2,0,1,0)
RenderWorld()
FlipBuffers()

Goto begin
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Naughty Alien

This is simple way to create your 3D scene, so from there build it up..



If InitEngine3D() And InitSprite() And InitKeyboard() ;INITIALIZE YOUR ENGINE
   
  OpenWindow(0,0,0,640,480,"3D Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  OpenWindowedScreen(WindowID(0),0,0,640,480,0,0,0)
 
;LOAD YOUR MODELS, TEXTURE, CAMERA ETC HERE
   
   camera=CreateCamera(0, 0, 0, 100, 100)
   
 
    Repeat                                      ;HERE YOUR MAIN GAME LOOP STARTS
      ExamineKeyboard()
     
      Select WindowEvent()
        Case #PB_Event_CloseWindow
          Quit = #True
      EndSelect
     
     
      RenderWorld()
      FlipBuffers()
    Until KeyboardPushed(#PB_Key_Escape) Or Quit ;HERE YOUR MAIN GAME LOOP ENDS
Else
  MessageRequester("Error", "Cant init 3D Engine",0)
EndIf
 
End

GaborD

Nicely simple, reminds me of the languages I like.

Pfaber11

#3
Thanks guys got it sorted just a little oversight on my behalf .Had me stumped for 2 days but at least I won't make that mistake again . It was all to do with Add3Darchive. I bet loads of programmers have done the same . Anyway I'm off the start line now the next thing I'll be looking at is detecting collisions . I've been at this a week now and want to be up to where I was with AGK as soon as possible . The 3d stuff seems very similar , one calls them entity's and the other objects but they are not that much different . After this I guess It's got to be terrain and height maps for me .
     Today was the first time I'd used the debug feature and I must say it was very useful. As for the rest of today I think I've learnt enough for one day . There's still a lot to learn like changing the colour of the background or putting the sky in but I'll try and get that sorted tomorrow . No regrets so far for taking on PB really quite enjoying it although the last couple of days have been tough . Got a nice little modelling program for converting .obj files into Ogre .mesh files and the name of it is DeleD strange name but there you go and it works that's the main thing . Blender does pretty much the same but had to install an older version of blender as the new one does not work very well with plugins . 2.8 doesn't work but 2.6 does . Go figure . Anyway my moneys on DeleD for doing the conversion . It's simpler . Thanks for reading .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz