Publié : mer. 29/mars/2006 16:49
Pour des collisions non glissantes, il faut augmenter la friction.
Forums PureBasic - Français
https://www.purebasic.fr/french/
14:29:32: Creating resource group General
14:29:32: Registering ResourceManager for type Material
14:29:32: Registering ResourceManager for type Mesh
14:29:32: Registering ResourceManager for type Skeleton
14:29:32: OverlayElementFactory for type Panel registered.
14:29:32: OverlayElementFactory for type BorderPanel registered.
14:29:32: OverlayElementFactory for type TextArea registered.
14:29:32: Registering ResourceManager for type Font
14:29:32: ArchiveFactory for archive type FileSystem registered.
14:29:32: ArchiveFactory for archive type Zip registered.
14:29:32: DevIL version: Developer's Image Library (DevIL) 1.6.7 Aug 15 2005
14:29:32: DevIL image formats: jpg jpe jpeg pcx png tga vda icb vst raw
14:29:32: Registering ResourceManager for type HighLevelGpuProgram
14:29:32: Direct3D7 Rendering Subsystem created.
14:29:32: ----- DirectDraw Detection Starts
14:29:32: Detected DirectDraw driver Pilote d'affichage principal
14:29:32: ----- DirectDraw Detection Ends
14:29:32: Particle Emitter Type 'Point' registered
14:29:32: Particle Emitter Type 'Box' registered
14:29:32: Particle Emitter Type 'Ellipsoid' registered
14:29:32: Particle Emitter Type 'Cylinder' registered
14:29:32: Particle Emitter Type 'Ring' registered
14:29:32: Particle Emitter Type 'HollowEllipsoid' registered
14:29:32: Particle Affector Type 'LinearForce' registered
14:29:32: Particle Affector Type 'ColourFader' registered
14:29:32: Particle Affector Type 'ColourFader2' registered
14:29:32: Particle Affector Type 'ColourImage' registered
14:29:32: Particle Affector Type 'ColourInterpolator' registered
14:29:32: Particle Affector Type 'Scaler' registered
14:29:32: Particle Affector Type 'Rotator' registered
14:29:32: TerrainSceneManager: Registered a new PageSource for type Heightmap
14:29:32: Registering ResourceManager for type BspLevel
14:29:32: *-*-* OGRE Initialising
14:29:32: *-*-* Version 1.0.7 (Azathoth)
14:29:32: ***************************************
*** Direct3D Subsystem Initialising ***
***************************************
14:29:32: *****************************************
14:29:32: *** Direct3D Subsystem Initialised Ok ***
14:29:32: *****************************************
14:29:32: Registering ResourceManager for type GpuProgram
14:29:32: ResourceBackgroundQueue - threading disabled
14:29:32: D3D7 : Created D3D7 Rendering Window 'PureBasic Ogre' : 1280x1024, 32bpp
14:29:32: Creating DirectDraw surfaces for window with dimensions:
14:29:32: FULLSCREEN w:1280 h:1024 bpp:32
14:29:32: Successfully created full screen rendering surface / flipping chain.
14:29:32: ----- Direct3D Detection Starts
14:29:32: Detected Direct3D Device Microsoft Direct3D RGB Software Emulation
14:29:32: Direct3D Device Capabilities:
14:29:32: Hardware Accelerated: 0
14:29:32: Mipmapping: 1
14:29:32: Bilinear Filtering: 1
14:29:32: Trilinear Filtering: 1
14:29:32: Hardware Transform & Light: 0
14:29:32: Max rendering colour depth: 32
14:29:32: Max single-pass texture layers: 8
14:29:32: Pixel fog supported: 256
14:29:32: Vertex fog supported: 128
14:29:32: This device needs a Z-Buffer
14:29:32: Detected Direct3D Device Microsoft Direct3D Hardware acceleration through Direct3D HAL
14:29:32: Direct3D Device Capabilities:
14:29:32: Hardware Accelerated: 1
14:29:32: Mipmapping: 1
14:29:32: Bilinear Filtering: 1
14:29:32: Trilinear Filtering: 1
14:29:32: Hardware Transform & Light: 0
14:29:32: Max rendering colour depth: 32
14:29:32: Max single-pass texture layers: 8
14:29:32: Pixel fog supported: 256
14:29:32: Vertex fog supported: 128
14:29:32: This device needs a Z-Buffer
14:29:32: Detected Direct3D Device Microsoft Direct3D Hardware Transform and Lighting acceleration capable device
14:29:32: Direct3D Device Capabilities:
14:29:32: Hardware Accelerated: 1
14:29:32: Mipmapping: 1
14:29:32: Bilinear Filtering: 1
14:29:32: Trilinear Filtering: 1
14:29:32: Hardware Transform & Light: 1
14:29:32: Max rendering colour depth: 32
14:29:32: Max single-pass texture layers: 8
14:29:32: Pixel fog supported: 256
14:29:32: Vertex fog supported: 128
14:29:32: This device needs a Z-Buffer
14:29:32: ----- Direct3D Detection Ends
14:29:32: Determining best 3D Device...
14:29:32: Best 3D Device is: Microsoft Direct3D Hardware Transform and Lighting acceleration capable device
14:29:33: Direct3D - Creating Z-Buffer
14:29:33: Depth-Buffer created (32-bit, 8-bit stencil)
14:29:33: Registering ResourceManager for type Texture
14:29:33: RenderSystem capabilities
14:29:33: -------------------------
14:29:33: * Hardware generation of mipmaps: no
14:29:33: * Texture blending: yes
14:29:33: * Anisotropic texture filtering: yes
14:29:33: * Dot product texture operation: yes
14:29:33: * Cube mapping: yes
14:29:33: * Hardware stencil buffer: yes
14:29:33: - Stencil depth: 8
14:29:33: - Two sided stencil support: no
14:29:33: - Wrap stencil values: yes
14:29:33: * Hardware vertex / index buffers: no
14:29:33: * Vertex programs: no
14:29:33: * Fragment programs: no
14:29:33: * Texture Compression: no
14:29:33: * Scissor Rectangle: no
14:29:33: * Hardware Occlusion Query: no
14:29:33: * User clip planes: no
14:29:33: * VET_UBYTE4 vertex element type: no
14:29:33: * Infinite far plane projection: no
14:29:33: * Hardware render-to-texture: no
14:29:33: * Floating point textures: no
14:29:33: * Non-power-of-two textures: no
14:29:33: * Volume textures: no
14:29:33: Particle Renderer Type 'billboard' registered
14:29:33: Added resource location './Temple/' of type 'FileSystem' to resource group 'General'
14:29:33: Added resource location './Sphere/' of type 'FileSystem' to resource group 'General'
14:29:33: Added resource location './Cube/' of type 'FileSystem' to resource group 'General'
14:29:33: Added resource location './Robot/' of type 'FileSystem' to resource group 'General'
14:29:33: Added resource location './Textures/' of type 'FileSystem' to resource group 'General'
14:29:33: Parsing scripts for resource group General
14:29:33: Parsing script Temple.material
14:29:33: Parsing script Robot.material
14:29:33: Finished parsing scripts for resource group General
14:29:33: Texture: Wall06.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
14:29:33: Texture: RustySteel.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
14:29:33: Texture: smoke.jpg: Loading 1 faces(PF_B8G8R8,64x64x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,64x64x1.
14:29:33: Mesh: Loading Temple.mesh.
14:29:33: Mesh: Loading Sphere.mesh.
14:29:33: Mesh: Loading Cube.mesh.
14:29:33: Texture: Wall12.jpg: Loading 1 faces(PF_B8G8R8,256x255x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
14:29:33: Texture: Wood01.jpg: Loading 1 faces(PF_B8G8R8,253x299x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x512x1.
14:29:33: Texture: Wall02.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
14:29:34: Texture: Wood02.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E2 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: Texture: Flare.png: Loading 1 faces(PF_B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
14:29:34: WARNING: Mesh instance 'M12394136' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12394248 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12394304' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12394416 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12394472' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12394584 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12394640' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12394752 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12394808' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12394920 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12394976' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12395088 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12395144' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12395256 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12395312' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12395424 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12395480' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12395592 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12395648' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12395760 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: WARNING: Mesh instance 'M12395816' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
14:29:34: Can't assign material PorcelaineShader to SubEntity of E12395928 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: Can't assign material 1 - Default to SubEntity of E12395984 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: Can't assign material 1 - Default to SubEntity of E12396040 because this Material does not exist. Have you forgotten to define it in a .material script?
14:29:34: Creating viewport on target 'PureBasic Ogre', rendering from camera 'MyCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
14:29:34: Viewport for camera 'MyCam', actual dimensions L: 0 T: 0 W: 1280 H: 1024
14:29:34: Texture: spot_shadow_fade.png: Loading 1 faces(PF_B8G8R8,128x128x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
14:30:28: WARNING: Mesh instance 'M7' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
Ah oui c'est vrai que j'avais supprimé le fichier PorcelaineShader.material,Can't assign material PorcelaineShader
c'est pas vraiment une erreur , juste un avertissement et effectivement j'ai des meshes faites manuellement.WARNING: Mesh instance 'M12395648' was defined as manually loaded,
Code : Tout sélectionner
;Comtois 10/02/06
;PB4.0 Beta 7
Source$="D:\Ogre\OgreCommandLineTools-1.0.6\Temple.xml" ; <<<< Fichier du mesh dans le format Xml
Destination$="D:\Ogre\OgreCommandLineTools-1.0.6\TempleTriangles.HD" ; <<<< Fichier contenant la liste des triangles
Structure s_Boite
Xmini.f
Ymini.f
Zmini.f
Xmaxi.f
Ymaxi.f
Zmaxi.f
EndStructure
Structure Face
v1.l
v2.l
v3.l
EndStructure
Structure Point3D
x.f
y.f
z.f
EndStructure
Structure Vecteur
x.f
y.f
z.f
EndStructure
Structure Triangle
P1.Point3D
P2.Point3D
P3.Point3D
Constante.f
Normale.Vecteur
EndStructure
NewList Face.Face()
Global NewList ListTriangle.Triangle()
Global Boite.s_Boite
Procedure.s StringFieldPerso(T$,Index)
Champ=0
Deb=0
Chaine$=""
For i=1 To Len(T$)
Car$=Mid(T$,i,1)
If Car$=Chr(34)
If Deb=0
Deb=1
Champ + 1
Continue
Else
Deb=0
EndIf
EndIf
If Champ=Index And Deb
Chaine$=Chaine$+Car$
EndIf
Next i
ProcedureReturn Chaine$
EndProcedure
OpenConsole()
SubMesh = 0
If OpenFile(0,Source$)
PrintN("Ouverture du fichier Xml : " + Source$)
While Eof(0)=0
Ligne$=ReadString(0)
If FindString(Ligne$,"<faces count=",1)
Pos=FindString(Ligne$,"count=",1)
Pos + 7
NbFace=Val(Mid(Ligne$,Pos,Len(Ligne$)-Pos-1))
SubMesh + 1
PrintN("SubMesh No : " + Str(SubMesh))
PrintN("Nombre de triangles : " + Str(NbFace))
;Lecture des Faces
ClearList(Face())
For i=1 To NbFace
Ligne$=ReadString(0)
AddElement(Face())
Face()\v1=Val(StringFieldPerso(Ligne$,1))
Face()\v2=Val(StringFieldPerso(Ligne$,2))
Face()\v3=Val(StringFieldPerso(Ligne$,3))
Next i
EndIf
;Cherche les vertices
If FindString(Ligne$,"<geometry vertexcount=",1)
Pos=FindString(Ligne$,"count=",1)
Pos + 7
NbVertex=Val(Mid(Ligne$,Pos,Len(Ligne$)-Pos-1))
PrintN("Nombre de sommets : " + Str(NbVertex))
Dim Vertex.Vecteur(NbVertex)
Dim Normale.Vecteur(NbVertex)
EndIf
If FindString(Ligne$,"<vertexbuffer",1)
Index=0
EndIf
;Lecture des vertex
If FindString(Ligne$,"<position",1)
Vertex(Index)\x=ValF(StringFieldPerso(Ligne$,1))
Vertex(Index)\y=ValF(StringFieldPerso(Ligne$,2))
Vertex(Index)\z=ValF(StringFieldPerso(Ligne$,3))
If Vertex(Index)\x < Boite\Xmini
Boite\Xmini = Vertex(Index)\x
ElseIf Vertex(Index)\x > Boite\Xmaxi
Boite\Xmaxi = Vertex(Index)\x
EndIf
If Vertex(Index)\y < Boite\Ymini
Boite\Ymini = Vertex(Index)\y
ElseIf Vertex(Index)\y > Boite\Ymaxi
Boite\Ymaxi = Vertex(Index)\y
EndIf
If Vertex(Index)\z < Boite\Zmini
Boite\Zmini = Vertex(Index)\z
ElseIf Vertex(Index)\z > Boite\Zmaxi
Boite\Zmaxi = Vertex(Index)\z
EndIf
EndIf
;Lecture des normales
If FindString(Ligne$,"<normal",1)
Normale(Index)\x=ValF(StringFieldPerso(Ligne$,1))
Normale(Index)\y=ValF(StringFieldPerso(Ligne$,2))
Normale(Index)\z=ValF(StringFieldPerso(Ligne$,3))
Index + 1
EndIf
;On peut enregistrer ce submesh
If FindString(Ligne$,"</vertexbuffer>",1)
ForEach Face()
AddElement(ListTriangle())
;v1
ListTriangle()\P1\x=Vertex(Face()\v1)\x
ListTriangle()\P1\y=Vertex(Face()\v1)\y
ListTriangle()\P1\z=Vertex(Face()\v1)\z
;v2
ListTriangle()\P2\x=Vertex(Face()\v2)\x
ListTriangle()\P2\y=Vertex(Face()\v2)\y
ListTriangle()\P2\z=Vertex(Face()\v2)\z
;v3
ListTriangle()\P3\x=Vertex(Face()\v3)\x
ListTriangle()\P3\y=Vertex(Face()\v3)\y
ListTriangle()\P3\z=Vertex(Face()\v3)\z
ListTriangle()\Normale\x=(Normale(Face()\v1)\x + Normale(Face()\v2)\x +Normale(Face()\v3)\x)/3
ListTriangle()\Normale\y=(Normale(Face()\v1)\y + Normale(Face()\v2)\y +Normale(Face()\v3)\y)/3
ListTriangle()\Normale\z=(Normale(Face()\v1)\z + Normale(Face()\v2)\z +Normale(Face()\v3)\z)/3
Next
EndIf
Wend
CloseFile(0)
PrintN("Total triangles : " + Str(CountList(ListTriangle())))
EndIf
;Génère un fichier contenant la liste des triangles
If CreateFile(0,Destination$)
PrintN("Creation du fichier triangle : " + Destination$)
WriteLong(0,CountList(ListTriangle()))
WriteData(0,@Boite,SizeOf(s_Boite))
ForEach ListTriangle()
WriteData(0,@ListTriangle(),SizeOf(Triangle))
Next
CloseFile(0)
PrintN("Operation terminee")
PrintN("Pressez la touche [Entree] pour quitter")
EndIf
PrintN("MiniX = " + StrF(Boite\XMini,3))
PrintN("MaxiX = " + StrF(Boite\XMaxi,3))
PrintN("MiniY = " + StrF(Boite\YMini,3))
PrintN("MaxiY = " + StrF(Boite\YMaxi,3))
PrintN("MiniZ = " + StrF(Boite\ZMini,3))
PrintN("MaxiZ = " + StrF(Boite\ZMaxi,3))
Input()
CloseConsole()
End
oui j'ai prévénu, j'ai encore du boulot pour améliorer le trucProgi1984 a écrit :Bugs rencontrés :
* je rentre dans les plateformes
J'ai aussi constaté ça , je ne sais si c'est un bug de PureBasic, il faudrait que je prenne le temps de faire un petit snippet pour le mettre en évidence.* quand une boule explose, j'ai des triangles qui parfois sont énormes (aléatoires ?)