Page 3 of 3

Re: What file format works best when using Assimpconverter?

Posted: Sat Nov 01, 2025 4:05 pm
by Distorted Pixel
minimy wrote: Sat Nov 01, 2025 1:18 pm Hello DP and caronte, export transparent objects and solid objects separate.
I did export the goal posts and the net separately. I only when creating the net I only imported the goal posts long enough to make sure the net was going to fit properly and make any adjustments to the net if needed. Then I deleted the goal posts and exported the net by itself.
For simple mesh like football field you can create a plane
My problem with using a plane created with PB is that I needed the soccer field to be scaled to official measurements or as close to it as possible. To get proper measurements for the soccer field I had to cut the borders of the image off and scale the field to correct measurements in Blender, then add the borders back in, each being its own separate object.

Measurements for the soccer field: Length = 100 meters, Width = 66 meters measured from outside of line to outside of line on opposite side of field. If I left the borders on the image, (which I tried) it would be harder to measure in Blender. Yes, it can be done in Blender because as I said, I tried it. It was too tedious for me so I cut the borders off and scaled to 100x66.
Hope this helps
Yes, you have helped me learn tremendously, thank you.
I believe I have learned enough from you and Caronte3D to make a good starter project, thank you both for your time and information

Re: What file format works best when using Assimpconverter?

Posted: Sat Nov 01, 2025 7:41 pm
by Distorted Pixel
I have been running multiple programs such as Blender, Brave browser and PB all at the same time to accomplish things quicker, but I believe it may have had something to do with corrupting the file along with maybe multiple versions of Blender. So, now I only run one program at a time.

I just made a new net with thicker net look and it works great

Re: What file format works best when using Assimpconverter?

Posted: Mon Nov 03, 2025 12:32 pm
by minimy
I think if you are making a football field the easy way is use deled. For geometric objects is really nice. The field maybe a box and the goals too, just need remove one face, the poles of the goal cubes. You can 'pre render' shadows too and export direct to ogre, just need change materials with your settings and may be change transparent textures with png files.
I think you can save time. Complete football field in one object, later use transparent object for colisions like cubes or planes to keep speed.

Re: What file format works best when using Assimpconverter?

Posted: Tue Nov 04, 2025 12:58 am
by Distorted Pixel
minimy wrote: Mon Nov 03, 2025 12:32 pm I think if you are making a football field the easy way is use deled. For geometric objects is really nice. The field maybe a box and the goals too, just need remove one face, the poles of the goal cubes. You can 'pre render' shadows too and export direct to ogre, just need change materials with your settings and may be change transparent textures with png files.
I think you can save time. Complete football field in one object, later use transparent object for colisions like cubes or planes to keep speed.
I tried to load the net into Deled and it caused it to operate extremely slow, basically unusable. So slow it would probably take a month to get anything done, seriously. The goal posts on the other hand worked fine.

Re: What file format works best when using Assimpconverter?

Posted: Tue Nov 04, 2025 2:53 pm
by Distorted Pixel
I created a new net in Blender last night. I left out one step i was doing because I felt there was no need for it. I exported a .mesh from fragmotion and it came out great I PB.

I just have one more thing to fix. The soccer field center line on the far side doesn't show up well unless I move the camera closer. I'll work on it tonight after work.

Re: What file format works best when using Assimpconverter?

Posted: Tue Nov 04, 2025 7:43 pm
by minimy
Distorted Pixel wrote: Tue Nov 04, 2025 2:53 pm I created a new net in Blender last night. I left out one step i was doing because I felt there was no need for it. I exported a .mesh from fragmotion and it came out great I PB.

I just have one more thing to fix. The soccer field center line on the far side doesn't show up well unless I move the camera closer. I'll work on it tonight after work.
That may be that the faces are at the same height. Try raising it just a little, 0.1 for example

Re: What file format works best when using Assimpconverter?

Posted: Wed Nov 05, 2025 1:38 am
by Distorted Pixel
minimy wrote: Tue Nov 04, 2025 7:43 pm
Distorted Pixel wrote: Tue Nov 04, 2025 2:53 pm I created a new net in Blender last night. I left out one step i was doing because I felt there was no need for it. I exported a .mesh from fragmotion and it came out great I PB.

I just have one more thing to fix. The soccer field center line on the far side doesn't show up well unless I move the camera closer. I'll work on it tonight after work.
That may be that the faces are at the same height. Try raising it just a little, 0.1 for example
I will have to try that tomorrow after work. I have to remake each piece which won't take long, but it will take longer than I have tonight. Somehow all my field object (.obj) have gotten corrupt. When I import them in for example the soccer field itself not the borders, should be x axis size should be 100 meters and the y axis size should be 66 meters. It shows x = 100 meters and y = 0 and z = 66. It shows up in blender correctly though.

I will redo them tomorrow quick and post back after I raise them

Re: What file format works best when using Assimpconverter?

Posted: Thu Nov 06, 2025 1:13 am
by Distorted Pixel
The meshes I am using are planes. The field and the 4 borders. I tried extracting the field plane up to 0.1 and it didn't help.

I also tried changing the field image size 1379x 872x24 bit from indexed to RGB, but that didn't help, if it helped any it was very very little.

The next thing I will try is converting the .obj files using the OrgeAssimpConverter instead of fragmotion. I will post an image tomorrow showing what I am talking about to give a visual of what is going on.

Re: What file format works best when using Assimpconverter?

Posted: Fri Nov 07, 2025 1:41 am
by Distorted Pixel
I did one better, I created a video of the results.

Watch the white lines as the camera moves around the field. I also tried to use a test image of some lines and it does the same thing.

What is the problem? How can I fix this? I even tried setting the camera range way out.
https://drive.proton.me/urls/6Y84TWJKWW#ULJqkktFWRCp

Current code:

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, 1920, 1080, "European Football Simulator", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 1920, 1080, 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, -500, #PB_Light_Point)
LightLookAt(0, 0, 0, 0)
;AmbientColor(RGBA(255, 255, 255, 255))
; load textures
;LoadTexture(0, "test.png")
LoadTexture(0, "fieldCutEditedStraightLinesOnly.png")               ; pitch (playing field)
LoadTexture(1, "OuterBorderBottomSide.png")  ; bottom border
LoadTexture(2, "OutBorderTopSide.png")       ; top border
LoadTexture(3, "OutBorderRightEnd.png")      ; right border
LoadTexture(4, "OuterBorderLeftSide.png")    ; left border
LoadTexture(5, "GoalPosts.png")              ; goal post used for left and right
LoadTexture(6, "Nets.png")                   ; goal net used for left and right

; 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
NetsMatRight   = CreateMaterial(7, TextureID(6)) ; goal net right

; load meshes
LoadMesh(0, "Pitch.mesh")          ; pitch (playing field)
LoadMesh(1, "BottomBorder.mesh")   ; bottom border
LoadMesh(2, "TopBorder.mesh")      ; top border
LoadMesh(3, "RightBorder.mesh")    ; right border
LoadMesh(4, "LeftBorder.mesh")     ; left border
LoadMesh(5, "GoalPostsLeft.mesh")  ; goal post frame used for both left and right side
LoadMesh(6, "GoalPostsRight.mesh") ; goal post frame right side
LoadMesh(7, "Net3.mesh")    ; goal net used for both left and right side

; 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(6), GoalPostsMat)         ; right goal posts frame
CreateEntity(7, MeshID(7), NetsMat)              ; left net
CreateEntity(8, MeshID(7), NetsMat)              ; right net created from mesh 7



SetMeshMaterial(7, NetsMat)
SetMeshMaterial(8, NetsMat)

RotateEntity(7, 0, 90, 0, #PB_Absolute)
RotateEntity(8, 0, -90, 0, #PB_Absolute)

MoveEntity(5, -50.50, 0, 0, #PB_World)    ; left goal posts frame
MoveEntity(7, -50.49, 0, 0, #PB_World)    ; left net 
MoveEntity(8, 50.67, 0, 0, #PB_World)      ; net right goal
;MoveEntity(1, 0, -0.001, 0, #PB_World)

; For x = 0 To 8
;   ScaleEntity(x, 5, 5, 5, #PB_Absolute)
; Next x

; create camera
CreateCamera(#Camera, 0, 0, 100, 100)
MoveCamera(#Camera, 0, 30, 90, #PB_Absolute | #PB_Local) ; absolute + local positive Z coordinate moves camera backwards
CameraRange(#Camera, 0, 1000000)
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

Re: What file format works best when using Assimpconverter?

Posted: Fri Nov 07, 2025 9:49 am
by miso
It is because of mipmapping, and caused by the wrong mesh composition and uv-ing.

You can reduce the effect (but can not eliminate it completely), paste this at line 40

Code: Select all

For x = 0 To 7
  MaterialFilteringMode(x,#PB_Material_Anisotropic,4)
  SetMaterialAttribute(x,#PB_Material_TAM,#PB_Material_ClampTAM)
Next x
True solution would be to make a correct mesh. The ground is composed of 5 meshes, but it is a plane only. I would create a single texture that has the borders and everything, and would make only a single plane for this. Also, the net is a mesh, and it is not optimal for realtime rendering in my opinion.

Re: What file format works best when using Assimpconverter?

Posted: Fri Nov 07, 2025 2:00 pm
by Distorted Pixel
I will go ahead and use the original image with one plane.

Thank you all for your help and patience with me. I have learned a lot from this. I will get better as I get experience in PB 3D

Re: What file format works best when using Assimpconverter?

Posted: Sat Nov 08, 2025 1:25 am
by Distorted Pixel
@miso

So far I changed the soccer field to one mesh and changed the code you gave me to the following seems to work the best. Your original code distorted the field image so bad it was a blur.

Code: Select all

  MaterialFilteringMode(x,#PB_Material_Anisotropic)
  SetMaterialAttribute(x,#PB_Material_EnvironmentMap,0); #PB_Material_TAM,#PB_Material_ClampTAM)
Next x
The first version of my game will only have the camera move left, right, up and down as the players run around and stay on one side of the field. The camera will follow the ball.

I'm not sure what the code does clearly, but I have an idea. I will learn what it is over time. I played around with the code you gave me and that is what I came up with so far. I might make adjustments as needed, but for the most part it is tolerable for now. I will be editing the image at some point.