Orge exporter version

Just starting out? Need help? Post your questions and find answers here.
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Orge exporter version

Post by Distorted Pixel »

Hi, what version of Orge exporter do we need for meshes in PB 6? Is it 0.14.0?

Edit: 9-26-22
The reason I'm asking is I have been trying to modify the example code from the help files of creating a plane with a mesh, texture and material I created, but I get the following error:

[ERROR] The specified #mesh is not initialized.

I can post the code after work today
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Here is the code. It errors on CreateEntity() line

I'm sorry for starting this thread here, I probably should have started it in the 3d section. My intention for starting it here is because I still consider myself a beginner sorta.

Code: Select all

UsePNGImageDecoder
InitSprite() : InitEngine3D

OpenWindow(0, 0, 0, 1024, 768, "Plane example", #PB_Windows_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 1024, 768, 0, 0, 0)
Add3dArchive("Entities\testfield.mesh", #PB_3DArchive_FileSystem)
Add3DArchive("Entities\testfield.material", #PB_Archive_FileSystem)

LoadMesh(0, "Entities\testfield.mesh")
LoadTexture(0, "Entities\testfield.png")
CreateMaterial(0, 0)

CreateEntity(0, MeshID(0), MaterialID(0)
SetEntityMaterial(0, MaterialID(0)

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 10, 1, 10, #PB_Absolute | #PB_Local)
CameraLookAt(0, 0, 0, 0)

Repeat
   RenderWorld()
   FlipBuffers()
Until WaitWindowEvent(1) = #PB_Event_CloseWindow    
Last edited by Distorted Pixel on Mon Sep 26, 2022 7:45 pm, edited 1 time in total.
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Orge exporter version

Post by Caronte3D »

Your code is full of syntax errors (on almost every line) :shock:
If you are a beginner, it is better that you study code that works (in this forum there is a lot) and modify it little by little to learn.
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Orge exporter version

Post by Caronte3D »

Code: Select all

UsePNGImageDecoder()
InitEngine3D()
InitSprite() 

OpenWindow(0, 0, 0, 1024, 768, "Plane example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 1024, 768, 0, 0, 0)
Add3DArchive("C:\Program Files\PureBasic\Examples\3D\Data\Textures", #PB_3DArchive_FileSystem )
Add3DArchive("C:\Program Files\PureBasic\Examples\3D\Data\Models", #PB_3DArchive_FileSystem)

LoadMesh(0, "C:\Program Files\PureBasic\Examples\3D\Data\Models\chassis.mesh")
LoadTexture(0, "C:\Program Files\PureBasic\Examples\3D\Data\Textures\RustySteel.jpg")
CreateMaterial(0, TextureID(0))

CreateEntity(0, MeshID(0), MaterialID(0) )
SetEntityMaterial(0, MaterialID(0))

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 10, 1, 10, #PB_Absolute | #PB_Local)
CameraLookAt(0, 0, 0, 0)

Repeat
   RenderWorld()
   FlipBuffers()
Until WaitWindowEvent(1) = #PB_Event_CloseWindow    
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Caronte3D wrote: Mon Sep 26, 2022 7:01 pm Your code is full of syntax errors (on almost every line) :shock:
If you are a beginner, it is better that you study code that works (in this forum there is a lot) and modify it little by little to learn.
I may have made some mistakes in posting the code because I typed it in by hand while reading it from a print out I brought to work. When I run it it doesn't get an error until the CreateEntity() line

I ran the help file code example for creating a plane and it works.
I understand what you are saying, yes I might be trying to modify too much to fast
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: Orge exporter version

Post by Olli »

Small help, in your code :

Code: Select all

LoadMesh(0, "C:\Program Files\PureBasic\Examples\3D\Data\Models\chassis.mesh")
LoadTexture(0, "C:\Program Files\PureBasic\Examples\3D\Data\Textures\RustySteel.jpg")
You should add a safety by replacing these two lines with this :

Code: Select all

mesh = LoadMesh(#PB_Any, "chassis.mesh")
texture = LoadTexture(#PB_Any, "RustySteel.jpg")
Debug "mesh load = " + mesh
Debug "texture load = " + texture
End
If it displays 0 anywhere in the debugger output, this means the compiler does not find anything about files.

With this, what are the results now you can get in the debugger ?
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Olli wrote: Mon Sep 26, 2022 7:58 pm Small help, in your code :

Code: Select all

LoadMesh(0, "C:\Program Files\PureBasic\Examples\3D\Data\Models\chassis.mesh")
LoadTexture(0, "C:\Program Files\PureBasic\Examples\3D\Data\Textures\RustySteel.jpg")
You should add a safety by replacing these two lines with this :

Code: Select all

mesh = LoadMesh(#PB_Any, "chassis.mesh")
texture = LoadTexture(#PB_Any, "RustySteel.jpg")
Debug "mesh load = " + mesh
Debug "texture load = " + texture
End
If it displays 0 anywhere in the debugger output, this means the compiler does not find anything about files.

With this, what are the results now you can get in the debugger ?
The code you just suggested a safety about is Caronte3D's code. Mine is in the second post from top. I will work on this when I get off work in a couple of hours
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: Orge exporter version

Post by Olli »

Distorted Pixel wrote:The code you just suggested a safety about is Caronte3D's code. Mine is in the second post from top.
I've always known how to make a mess, and, what's more, without doing it on purpose! :mrgreen:
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Olli wrote: Mon Sep 26, 2022 9:09 pm
Distorted Pixel wrote:The code you just suggested a safety about is Caronte3D's code. Mine is in the second post from top.
I've always known how to make a mess, and, what's more, without doing it on purpose! :mrgreen:
You're fine, I should have posted this in 3D area so we're in the same boat lol
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Ok,

I started with the CreatePlane() example code and only modified it just a bit and it works.
I should have modified a little at a time, Thank you all for helping

Code: Select all

  InitEngine3D()
  InitSprite()
  
  Add3DArchive("C:\Program Files\PureBasic\PureBasic Projects\Ultimate Football Manager\Images", #PB_3DArchive_FileSystem)
  
  OpenWindow(0, 0, 0, 1024, 768, "Plane example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  OpenWindowedScreen(WindowID(0), 0, 0, 1024, 768, 0, 0, 0)
  
  LoadTexture(0, "field.png")
  CreateMaterial(0, TextureID(0))
  
  ; Camera
  CreateCamera(0, 0, 0, 100, 100)
  MoveCamera(0, 1, 1, 1, #PB_Absolute | #PB_Local)
  CameraLookAt(0, 0, 0, 0)

  ; Create the plane and attach it to the scene
  CreatePlane(0, 1, 1, 1, 1, 0, 0)
  CreateEntity(0, MeshID(0), MaterialID(0))

  Repeat
    RenderWorld()
    FlipBuffers()
  Until WaitWindowEvent(1) = #PB_Event_CloseWindow
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

I believe I understand what the Add3dArchive() is now, it is simply to set the directory of where the media you want to load is at, then you just load given files you need
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: Orge exporter version

Post by Olli »

Yes, but it seems that Caronte3D wrote UsePNGimageDecoder() with brackets : here you have again forgotten these brackets. And the whole function also, until you want to load a png file.
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Olli wrote: Tue Sep 27, 2022 9:54 pm Yes, but it seems that Caronte3D wrote UsePNGimageDecoder() with brackets : here you have again forgotten these brackets. And the whole function also, until you want to load a png file.
I'll check my code after work today, I believe I didn't need to call UsePNGimageDecoder() in this part of my code because I called it earlier in my program already
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
User avatar
Distorted Pixel
Enthusiast
Enthusiast
Posts: 233
Joined: Sun Aug 29, 2021 4:34 am

Re: Orge exporter version

Post by Distorted Pixel »

Back to a question I had in beginning of this thread.

What version of Orge exporter works with PureBasic 6?
To be popular is way to much work. I just want to be me, myself and I. Oh no, does that mean I'm bipolar? :shock:

No one cares how much you know until they know how much you care
Post Reply