Yes, I will post an image or 2 for you plus some code. I will edit this post when I get it done in a few minutes
The first time I was successful with the net in Blender 2.83 I did not get an error, but every time after that I get the following error when trying to export to Orge format in
file. Why this happens now, I'm clueless. I have to export to Orge format using fragmotion instead.
The original net that I was succesful with was placed using Blender. I do not have that file anymore. The current net still needs to be placed, but I am concerned that it isn't showing properly.
Code: Select all
#MOVEMENT_SPEED = 0.15
#Camera = 1
Global MouseXRotation.f,MouseYRotation.f,KeyX.f,KeyZ.f
InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(0, 0, 0, 1200, 800, "European Football Simulator", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 1200, 800, 0, 0, #PB_Screen_WaitSynchronization)
Add3DArchive("C:\Users\Brian\Documents\PUREBASIC PROJECTS\3D Programs\3Dfield\Media", #PB_3DArchive_FileSystem)
;Parse3DScripts()
CreateLight(0,RGB(255, 255, 255), 0, 50, -40, #PB_Light_Directional)
; load textures
LoadTexture(0, "fieldCut.png")
LoadTexture(1, "OuterBorderBottomSide.png")
LoadTexture(2, "OutBorderTopSide.png")
LoadTexture(3, "OutBorderRightEnd.png")
LoadTexture(4, "OuterBorderLeftSide.png")
LoadTexture(5, "GoalPosts.png")
LoadTexture(6, "Nets.png")
; create materials
FieldMat = CreateMaterial(0, TextureID(0)) ; pitch (playing field)
FieldBottomBorderMat = CreateMaterial(1, TextureID(1)) ; bottom border
FieldTopBorderMat = CreateMaterial(2,TextureID(2)) ; top border
FieldRightBorderMat = CreateMaterial(3,TextureID(3)) ; right border
FieldLeftBorderMat = CreateMaterial(4, TextureID(4)) ; left border
GoalPostsMat = CreateMaterial(5, TextureID(5)) ; goal posts frame
NetsMat = CreateMaterial(6, TextureID(6)) ; goal net
; load meshes
LoadMesh(0, "Pitch.mesh")
LoadMesh(1, "BottomBorder.mesh")
LoadMesh(2, "TopBorder.mesh")
LoadMesh(3, "RightBorder.mesh")
LoadMesh(4, "LeftBorder.mesh")
LoadMesh(5, "GoalPostsLeft.mesh")
LoadMesh(6, "NetLeft_obj.mesh")
; Result = SubMeshCount(0)
; Debug Result
CreateEntity(0, MeshID(0), FieldMat) ; pitch
CreateEntity(1, MeshID(1), FieldBottomBorderMat) ; bottom border
CreateEntity(2, MeshID(2), FieldTopBorderMat) ; top border
CreateEntity(3, MeshID(3), FieldRightBorderMat) ; right border
CreateEntity(4, MeshID(4), FieldLeftBorderMat) ; left border
CreateEntity(5, MeshID(5), GoalPostsMat) ; left goal posts frame
CreateEntity(6, MeshID(5), GoalPostsMat) ; right goal posts frame
CreateEntity(7, MeshID(6), NetsMat) ; left net used for both left and right
RotateEntity(6, 0, 180, 0, #PB_Absolute) ; right goal posts frame
MoveEntity(5, -50.66, 0, 0, #PB_World) ; left goal posts frame
MoveEntity(6, 50.68, 0, 0, #PB_World) ; right goal posts frame
; create camera
CreateCamera(#Camera, 0, 0, 100, 100)
MoveCamera(#Camera, 0, 50, 110, #PB_Absolute | #PB_Local) ; absolute + local positive Z coordinate moves camera backwards
CameraFOV(#Camera, 45)
CameraRange(#Camera, 1, 220)
CameraLookAt(#Camera, 0, 0, 0)
Repeat
Repeat : event=WindowEvent() : If event = #PB_Event_CloseWindow : End : EndIf :Until Not event
If ExamineMouse()
MouseYRotation = -MouseDeltaX() / 10
MouseXRotation = -MouseDeltaY() / 10
EndIf
RotateCamera(#Camera, MouseXRotation, MouseYRotation, 0, #PB_Relative)
;Update Key Presses and position the Camera accordingly
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left) : KeyX = -#MOVEMENT_SPEED : EndIf
If KeyboardPushed(#PB_Key_Right) : KeyX = #MOVEMENT_SPEED : EndIf
If KeyboardPushed(#PB_Key_Up) : KeyZ = -#MOVEMENT_SPEED : EndIf
If KeyboardPushed(#PB_Key_Down) : KeyZ = #MOVEMENT_SPEED : EndIf
If KeyboardPushed(#PB_Key_Escape) : ReleaseMouse(#True) : EndIf
MoveCamera(#Camera, KeyX, 0, KeyZ)
KeyX = 0
KeyZ = 0
EndIf
RenderWorld()
FlipBuffers()
Delay(1)
ForEver