Page 2 sur 3

Publié : jeu. 17/juin/2004 9:19
par comtois
Essaye plutôt ça !!

Code : Tout sélectionner

make matrix 1 ,10000,10000,125,125 

Sinon Filperj , j'ai changé il n'y a plus de limites ( sauf celle des 65000) . je vais mettre à jour le lien dans la journée ,quand j'aurai ajouté M3D_Setvisible() ou un truc dans le genre .

Publié : jeu. 17/juin/2004 10:12
par Backup
ben ça ça marche aussi !!

Code : Tout sélectionner

 make matrix 1 ,10000,10000,125,125
position camera 1000,100,100
rotate camera 0,40,0
wait key
:D

dailleur ça aussi :

Code : Tout sélectionner

 make matrix 1 ,10000,10000,900,900
position camera 1000,100,100
rotate camera 0,40,0
wait key
il bloque a

Code : Tout sélectionner

 make matrix 1 ,10000,10000,1000,1000
position camera 1000,100,100
rotate camera 0,40,0
wait key
:D

Publié : jeu. 17/juin/2004 11:07
par comtois
ça a changé alors :)

Ben tant pis , je vais me satisfaire de mes limitations , et toc :)

Pendant que j'y suis , pour ceux qui éventuellement seraient intéressés, je pense raccourcir le nom des fonctions ainsi :
Commandes :
M3D_CreateMesh(No.l, Largeur.f, Profondeur.f, NbFacetteX.l, NbFacetteZ.l, DoubleFace.l)
M3D_SetDoubleFace(No.l, DoubleFace.l)
M3D_PrepareTexture(No.l, Notexture.l, NbTextureX.l, NbTextureZ.l)
M3D_SetFacetteHeight(No.l, x.l, Z.l, Hauteur.f)
M3D_SetVertexHeight(No.l, x.l, Z.l, Hauteur.f)
M3D_TextureFacette(No.l, x.l, Z.l, NoTiletexture.l)
M3D_Normales(No.l)
M3D_FillMatrix(No.l, NoTiletexture.l)
M3D_UpDateTexture(No.l)
M3D_UpDateVertex(No.l)
M3D_MoveEntityXZ(No.l, NoEntity.l, Angle.f, Distance.f)
M3D_LoadMatrix(No.l, Fichier$)
M3D_SaveMatrix(No.l, Fichier$)
Informations :
M3D_GetGroundHeight(No.l, Xp.f, Zp.f)
M3D_GetVertexHeight(No.l, x.l, Z.l)
M3D_MatrixWidth(No.l)
M3D_MatrixHeight(No.l)
M3D_MaxFacetteX(No.l)
M3D_MaxFacettez(No.l)
M3D_FacetteHeight(No.l)
M3D_FacetteWidth(No.l)
M3D_MaxTextureX(No.l)
M3D_MaxTextureZ(No.l)
M3D_TextureHeight(No.l)
M3D_TextureWidth(No.l)

Et plutôt qu'un numéro de Tile pour la texture , Utiliser les coordonnées (X,Z) sur la texture ,ça permettrait d'avoir le même système de repérage pour les Vertex, les facettes et les textures.
Qu'en pensez vous ?

Publié : jeu. 17/juin/2004 12:13
par comtois
Je viens de mettre la nouvelle version sur mon site avec l'exemple de Filperj (279 ko)

http://perso.wanadoo.fr/comtois/M3D_Mat ... trix3D.zip

Dans cette version , je controle seulement la limite des 16380 facettes .

J'ai corrigé un bug dans la fonction FillMatrix().
Et ajouté 3 fonctions .

Bon il fait beau , je vais me balader :)


PS : Filperj , j'adore ta démo , mais pour manier la camera c'est pas top , j'aime mieux la vue de dessus , et pour y parvenir c'est pas simple ,ou alors j'ai pas le coup de patte !
Donc j'ai un peu modifié le code pour mieux voir la face qui me plait :)
il manque le déplacement avec la camera .

Code : Tout sélectionner

#pi=3.141593 
#larjmap=125 : #profmap=125 
#tailfacette=1 

Structure lignmap 
   x.l[#larjmap+1] 
EndStructure 
Structure hmap 
   Z.lignmap[#profmap+1] 
EndStructure 

Global _hmap.hmap 
Global Hauteur,Pas

Procedure initiale() 
    
   If InitEngine3D()=0 
      MessageRequester("AU SECOURS JE ME NGLOUGLouglou","échoué à initialiser la 3D - Vérifiez la présence de "+Chr('"')+"Engine3D.dll"+Chr('"')) 
      End 
   EndIf 
    
   If InitSprite()=0 Or InitKeyboard()=0 Or InitMouse()=0 Or OpenScreen(800,600,32,"Martin & Matrice")=0 
      MessageRequester("Aaaaargh!","échec de l'initialisation de DirectX7") 
      End 
   EndIf 
    
   CreateTexture(0,2,2) 
   StartDrawing(TextureOutput(0)) 
      Plot(0,0,$FFFFFF) 
      Plot(0,1,$FF) 
      Plot(1,0,$FF00) 
      Plot(1,1,$FF0000) 
   StopDrawing() 
   CreateMaterial(0,TextureID(0)) 
    
   M3D_CreateMeshMatrix(0,#larjmap*#tailfacette,#profmap*#tailfacette,#larjmap,#profmap,1) 
   CreateEntity(0,MeshID(0),MaterialID(0)) 
   EntityLocate(0,-#larjmap*#tailfacette/2,0,#profmap*#tailfacette) 
    
   M3D_PrepareMatrixTexture(0,0,1,1) 
   M3D_UpDateVertex(0) 
   M3D_FillMatrix(0,0) 
   M3D_UpDateTexture(0) 
    
    
   CreateLight(0,$FFFFFF,-#larjmap*#tailfacette/2,400,-#profmap*#tailfacette/2) 
    
EndProcedure 

Procedure martinet() 
    
   _hmap\Z[0]\x[0]=((_hmap\Z[#profmap]\x[0]+_hmap\Z[1]\x[0]+_hmap\Z[#profmap]\x[#larjmap]+_hmap\Z[0]\x[1])/4+1)&$3FF 
   For x=1 To #larjmap-1 
      _hmap\Z[0]\x[x]=((_hmap\Z[#profmap]\x[x]+_hmap\Z[1]\x[x]+_hmap\Z[0]\x[x-1]+_hmap\Z[0]\x[x+1])/4+1)&$3FF 
   Next 
   _hmap\Z[0]\x[#larjmap]=((_hmap\Z[#profmap]\x[#larjmap]+_hmap\Z[1]\x[#larjmap]+_hmap\Z[0]\x[#larjmap-1]+_hmap\Z[1]\x[0])/4+1)&$3FF 
    
   For Z=1 To #profmap-1 
      _hmap\Z[Z]\x[0]=((_hmap\Z[Z-1]\x[0]+_hmap\Z[Z+1]\x[0]+_hmap\Z[Z-1]\x[#larjmap]+_hmap\Z[Z]\x[1])/4+1)&$3FF 
      For x=1 To #larjmap-1 
         _hmap\Z[Z]\x[x]=((_hmap\Z[Z-1]\x[x]+_hmap\Z[Z+1]\x[x]+_hmap\Z[Z]\x[x-1]+_hmap\Z[Z]\x[x+1])/4+1)&$3FF 
      Next 
      _hmap\Z[Z]\x[#larjmap]=((_hmap\Z[Z-1]\x[#larjmap]+_hmap\Z[Z+1]\x[#larjmap]+_hmap\Z[Z]\x[#larjmap-1]+_hmap\Z[Z+1]\x[0])/4+1)&$3FF 
   Next 
    
   _hmap\Z[#profmap]\x[0]=((_hmap\Z[#profmap-1]\x[0]+_hmap\Z[0]\x[0]+_hmap\Z[#profmap-1]\x[#larjmap]+_hmap\Z[#profmap]\x[1])/4+1)&$3FF 
   For x=1 To #larjmap-1 
      _hmap\Z[#profmap]\x[x]=((_hmap\Z[#profmap-1]\x[x]+_hmap\Z[0]\x[x]+_hmap\Z[#profmap]\x[x-1]+_hmap\Z[#profmap]\x[x+1])/4+1)&$3FF 
   Next 
   _hmap\Z[#profmap]\x[#larjmap]=((_hmap\Z[#profmap-1]\x[#larjmap]+_hmap\Z[0]\x[#larjmap]+_hmap\Z[#profmap]\x[#larjmap-1]+_hmap\Z[0]\x[0])/4+1)&$3FF 
    
EndProcedure 

Procedure reinitmap() 
    
   debu=@_hmap 
   fin=debu+SizeOf(hmap)-4 
   For *ptr.LONG=debu To fin Step 4 
      *ptr\l=0 
   Next 
    
EndProcedure 

Procedure appmap() 
    
   For x=0 To #larjmap : For Z=0 To #profmap 
      M3D_SetVertexHeight(0,x,Z,_hmap\Z[Z]\x[x]/25) 
   Next:Next 
    
   M3D_UpDateVertex(0) 
   M3D_NormalesMatrix(0) 
    
EndProcedure 

;-DEPART 

initiale() 

CreateCamera(0,0,0,100,100) 
CameraLocate(0 , EntityX(0) , EntityY(0) + 50,  EntityZ(0)* 2)
CameraLookAt(0 , EntityX(0) , EntityY(0),  EntityZ(0)) 
;LightLocate(0, EntityX(0) , 500,  EntityZ(0)) 
   RotateEntity(0,180,-30,0)
Repeat 
    
   ExamineKeyboard() : ExamineMouse() 
    
   If KeyboardReleased(#PB_Key_Space) 
      reinitmap() 
     Else 
      martinet() 
   EndIf 
    
   appmap() 

   ClearScreen(0,0,0) 
   RenderWorld() 
   FlipBuffers() 
    
Until KeyboardReleased(#PB_Key_Escape) Or IsScreenActive()=0 

Publié : jeu. 17/juin/2004 18:09
par filperj
Bon, j'ai un peu amélioré la gestion de la caméra:
en plus de la souris, on a maintenant les flèches directionnelles et les touches "page up - page down".
La touche control gauche permet de basculer entre deux modes de rendu, mais le deuxième est... bof...
La barre espace réinitialise toujours la séquence.

Code : Tout sélectionner


#pi=3.141593


#larjmap=125 : #profmap=125
#tailfacette=1

Structure lignmap
   x.l[#larjmap+1]
EndStructure
Structure hmap
   z.lignmap[#profmap+1]
EndStructure

Global _hmap.hmap


Procedure initiale()
   
   If InitEngine3D()=0
      MessageRequester("AU SECOURS JE ME NGLOUGLouglou","échoué à initialiser la 3D - Vérifiez la présence de "+Chr('"')+"Engine3D.dll"+Chr('"'))
      End
   EndIf
   
   If InitSprite()=0 Or InitKeyboard()=0 Or InitMouse()=0 Or OpenScreen(800,600,32,"Martin & Matrice")=0
      MessageRequester("Aaaaargh!","échec de l'initialisation de DirectX7")
      End
   EndIf
   
   CreateTexture(0,2,2)
   StartDrawing(TextureOutput(0))
      Plot(0,0,$ffffff)
      Plot(0,1,$ff)
      Plot(1,0,$ff00)
      Plot(1,1,$ff0000)
   StopDrawing()
   CreateMaterial(0,TextureID(0))
   
   M3D_CreateMeshMatrix(0,#larjmap*#tailfacette,#profmap*#tailfacette,#larjmap,#profmap,1)
   CreateEntity(0,MeshID(0),MaterialID(0))
   
   M3D_PrepareMatrixTexture(0,0,1,1)
   M3D_UpDateVertex(0)
   M3D_FillMatrix(0,0)
   M3D_UpDateTexture(0)
   
   
   CreateLight(0,$ffffff,-#larjmap*#tailfacette/2,400,-#profmap*#tailfacette/2)
   
EndProcedure


Procedure martinet()
   
   _hmap\z[0]\x[0]=((_hmap\z[#profmap]\x[0]+_hmap\z[1]\x[0]+_hmap\z[#profmap]\x[#larjmap]+_hmap\z[0]\x[1])/4+1)&$3ff
   For x=1 To #larjmap-1
      _hmap\z[0]\x[x]=((_hmap\z[#profmap]\x[x]+_hmap\z[1]\x[x]+_hmap\z[0]\x[x-1]+_hmap\z[0]\x[x+1])/4+1)&$3ff
   Next
   _hmap\z[0]\x[#larjmap]=((_hmap\z[#profmap]\x[#larjmap]+_hmap\z[1]\x[#larjmap]+_hmap\z[0]\x[#larjmap-1]+_hmap\z[1]\x[0])/4+1)&$3ff
   
   For z=1 To #profmap-1
      _hmap\z[z]\x[0]=((_hmap\z[z-1]\x[0]+_hmap\z[z+1]\x[0]+_hmap\z[z-1]\x[#larjmap]+_hmap\z[z]\x[1])/4+1)&$3ff
      For x=1 To #larjmap-1
         _hmap\z[z]\x[x]=((_hmap\z[z-1]\x[x]+_hmap\z[z+1]\x[x]+_hmap\z[z]\x[x-1]+_hmap\z[z]\x[x+1])/4+1)&$3ff
      Next
      _hmap\z[z]\x[#larjmap]=((_hmap\z[z-1]\x[#larjmap]+_hmap\z[z+1]\x[#larjmap]+_hmap\z[z]\x[#larjmap-1]+_hmap\z[z+1]\x[0])/4+1)&$3ff
   Next
   
   _hmap\z[#profmap]\x[0]=((_hmap\z[#profmap-1]\x[0]+_hmap\z[0]\x[0]+_hmap\z[#profmap-1]\x[#larjmap]+_hmap\z[#profmap]\x[1])/4+1)&$3ff
   For x=1 To #larjmap-1
      _hmap\z[#profmap]\x[x]=((_hmap\z[#profmap-1]\x[x]+_hmap\z[0]\x[x]+_hmap\z[#profmap]\x[x-1]+_hmap\z[#profmap]\x[x+1])/4+1)&$3ff
   Next
   _hmap\z[#profmap]\x[#larjmap]=((_hmap\z[#profmap-1]\x[#larjmap]+_hmap\z[0]\x[#larjmap]+_hmap\z[#profmap]\x[#larjmap-1]+_hmap\z[0]\x[0])/4+1)&$3ff
   
EndProcedure




Structure noeud
   vit.f : hi.f
EndStructure


Procedure reinitmap(flip)
   
   debu=@_hmap
   fin=debu+SizeOf(hmap)-4
   For *ptr.long=debu To fin Step 4
      *ptr\l=1000;+Random(31)
   Next
   
   If flip
      Dim hmapf.noeud(#larjmap,#profmap)
   EndIf
   
EndProcedure







Procedure appmap1()
   
   For x=0 To #larjmap : For z=0 To #profmap
      hmapf(x,z)\vit+(_hmap\z[z]\x[x]-512-hmapf(x,z)\hi)*0.001
      hmapf(x,z)\hi+hmapf(x,z)\vit
      M3D_SetVertexHeight(0,x,z,hmapf(x,z)\hi/25)
   Next:Next
   
   M3D_UpDateVertex(0)
   M3D_NormalesMatrix(0)
   
EndProcedure




Procedure appmap0()
   
   For x=0 To #larjmap : For z=0 To #profmap
      M3D_SetVertexHeight(0,x,z,_hmap\z[z]\x[x]/25)
   Next:Next
   
   M3D_UpDateVertex(0)
   M3D_NormalesMatrix(0)
   
EndProcedure



#vitcam=4
Procedure gercam()
   
   Global rotx.f,roty.f
   
   rotx-MouseDeltaY()/400
   If rotx>#pi/2
      rotx=#pi/2
     ElseIf rotx<-#pi/2
      rotx=-#pi/2
   EndIf
   
   roty-MouseDeltaX()/400
   
   DefType.f vizx,vizy,vizz
   
   vizx=CameraX(0)+Sin(roty)*#vitcam
   vizz=CameraZ(0)+Cos(roty)*#vitcam
   vizy=CameraY(0)+Sin(rotx)*#vitcam
   
   CameraLookAt(0,vizx,vizy,vizz)
   
   If MouseButton(1)
      CameraLocate(0,vizx,vizy,vizz)
     ElseIf MouseButton(2)
      CameraLocate(0,2*CameraX(0)-vizx,2*CameraY(0)-vizy,2*CameraZ(0)-vizz)
     ElseIf KeyboardPushed(#pb_key_pageup)
      CameraLocate(0,CameraX(0),CameraY(0)+#vitcam,CameraZ(0))
     ElseIf KeyboardPushed(#pb_key_pagedown)
      CameraLocate(0,CameraX(0),CameraY(0)-#vitcam,CameraZ(0))
     ElseIf KeyboardPushed(#pb_key_up)
      CameraLocate(0,vizx,CameraY(0),vizz)
     ElseIf KeyboardPushed(#pb_key_down)
      CameraLocate(0,2*CameraX(0)-vizx,CameraY(0),2*CameraZ(0)-vizz)
     ElseIf KeyboardPushed(#pb_key_left)
      CameraLocate(0,CameraX(0)-Sin(roty-#pi/2)*#vitcam,CameraY(0),CameraZ(0)-Cos(roty-#pi/2)*#vitcam)
     ElseIf KeyboardPushed(#pb_key_right)
      CameraLocate(0,CameraX(0)+Sin(roty-#pi/2)*#vitcam,CameraY(0),CameraZ(0)+Cos(roty-#pi/2)*#vitcam)
   EndIf
   
EndProcedure



;-DEPART

initiale()
reinitmap(1)

CreateCamera(0,0,0,100,100)
CameraLocate(0,0,120,-100)
rotx=-#pi/2



Repeat
   
   ExamineKeyboard() : ExamineMouse()
   
   If KeyboardReleased(#pb_key_space)
      reinitmap(fliprendus)
     Else
      martinet()
   EndIf
   
   If KeyboardReleased(#pb_key_leftcontrol)
      fliprendus=1-fliprendus
   EndIf
   
   If fliprendus
      appmap1()
     Else
      appmap0()
   EndIf
   
   gercam()
   
   ClearScreen(0,0,0)
   RenderWorld()
   FlipBuffers()
   
Until KeyboardReleased(#pb_key_escape) Or IsScreenActive()=0

[J'ai édité le code, pas de grand changement]

Publié : jeu. 17/juin/2004 18:17
par comtois
Ah ben voila , impeccable , Julien qui cherchait comment faire des gouttes d'eau , il a un bel exemple avec ça :)

Publié : jeu. 17/juin/2004 21:41
par comtois
Je ferai un petit code tout simple plus tard pour montrer comment mettre une image entière sur une matrice ,mais j'étais curieux de voir ce que ça donnerait avec ton code , voila les lignes à modifier pour tester .

Bon , c'est bien mieux avec ta texture ,il y a les lignes qui se déforment , ou alors il faut trouver une image qui comporte pas mal de lignes .

Code : Tout sélectionner

LoadTexture(0,"Coucher de soleil.jpg")
   CreateMaterial(0,TextureID(0)) 
    
   M3D_CreateMeshMatrix(0,#larjmap*#tailfacette,#profmap*#tailfacette,#larjmap,#profmap,1) 
   CreateEntity(0,MeshID(0),MaterialID(0)) 
   EntityLocate(0,-#larjmap*#tailfacette/2,0,#profmap*#tailfacette) 
    
   M3D_PrepareMatrixTexture(0,0,#larjmap,#profmap) 
   For Z=0 To #profmap - 1
    For x=0 To #larjmap - 1
      No = x + #larjmap * Z
      M3D_TextureFacette(0,x,Z,No)
    Next x
  Next Z 
   ;M3D_UpDateVertex(0) 
   ;M3D_FillMatrix(0,0) 
   M3D_UpDateTexture(0) 

Publié : jeu. 17/juin/2004 22:18
par filperj
Si, c'est joli aussi :D

Au fait, le calcul des normales n'a pas l'air tout à fait au point (il me semble que tu t'en plaignait dans un autre post), est-ce que tu pourrais rajouter une commande pour régler la normale de chaque vertex "à la main", comme ça chacun pourra essayer diverses méthodes?

C'est tout ce que je vois qui manque, elle est déjà bien avancée cette petite lib :wink:

Publié : jeu. 17/juin/2004 22:28
par comtois
là j'étais en train de regarder pour ajouter ShiftUp , ShiftDown , ShiftLeft , et ShiftRight pour faire des terrains infinis :)

Ensuite je vais modifier la gestion des textures , il faudra donner les coordonnées x,z de la texture et plus un no ,ça sera homogène avec le repèrage des vertex et facettes .

J'avais aussi en tête de calculer les normales par une autre méthode qui sera plus lente , car il y a plus de calculs , mais qui devrait donner un ombrage plus doux .( Je garderais les deux méthodes)
Et je vais regarder comment je peux faire ce que tu demandes.

ça fera 3 méthodes pour les normales .

Publié : ven. 18/juin/2004 21:59
par comtois
http://perso.wanadoo.fr/comtois/M3D_Mat ... 180604.zip

Ajout de SetNormale() , UpDateNormale()
Ajout de ShiftUp() , ShiftDown(),ShiftLeft(),ShiftRight()

Il n'y a pas encore d'exemples pour ces nouvelles commandes, C'est en cours .

Finalement , je colle un petit exemple pour l'utilisation des shift.
J'en prépare un autre .

Code : Tout sélectionner

; Exemple No8 => Shift Matrix 
; Comtois le 18 juin 2004
; Pb 3.90

;-Constantes
;/ Ecran
#ScreenWidth = 800 
#ScreenHeight = 600
#ScreenDepth = 32

;/Matrix
#Matrix1 = 0

;- Structures
Structure Camera
  Angle.f
  Distance.l
  Hauteur.l
  Mode.l
EndStructure
Global Camera.Camera  

;{- Initialisation
If InitEngine3D() = 0
   MessageRequester( "Erreur" , "Impossible d'initialiser la 3D , vérifiez la présence de engine3D.dll" , 0 )
   End
ElseIf InitSprite() = 0 Or InitKeyboard() = 0 
   MessageRequester( "Erreur" , "Impossible d'initialiser DirectX 7 Ou plus" , 0 )
   End
ElseIf OpenScreen( #ScreenWidth , #ScreenHeight , #ScreenDepth , "Démo PlateForme" ) = 0
   MessageRequester( "Erreur" , "Impossible d'ouvrir l'écran " , 0 )
   End
EndIf
;}
;- Texture
LoadTexture(#Matrix1,"T16_64x64.png")

;- MAtière
CreateMaterial(#Matrix1, TextureID(#Matrix1))

;- Mesh 
M3D_CreateMeshMatrix(#Matrix1,300,300,5,5,1)
M3D_PrepareMatrixTexture(#Matrix1, #Matrix1, 4, 4)
For Z = 0 To 4
  For x = 0 To 4
    Read texture
    M3D_TextureFacette(#Matrix1, x, Z, texture)
  Next x
Next Z
M3D_SetFacetteHeight(#Matrix1, 2, 2, 40)
M3D_UpDateVertex(#Matrix1)
M3D_UpDateTexture(#Matrix1)
  
;- Matrix
CreateEntity(#Matrix1, MeshID(#Matrix1), MaterialID(#Matrix1))
M3D_NormalesMatrix(#Matrix1)
EntityLocate(#Matrix1, M3D_MatrixWidth(#Matrix1) / 2, 0, M3D_MatrixHeight(#Matrix1) / 2)
 
;- Camera
CreateCamera(0, 0, 0 , 100 , 100)
CameraLocate(0, EntityX(#Matrix1) , EntityY(#Matrix1) + 400, EntityZ(#Matrix1) * 4)
CameraLookAt(0, EntityX(#Matrix1), EntityY(#Matrix1), EntityZ(#Matrix1))

;- Light
AmbientColor(RGB(85,85,85)) 
CreateLight(0,RGB(255,255,255))
LightLocate(0,M3D_MatrixWidth(#Matrix1)  , 500, M3D_MatrixHeight(#Matrix1) / 2)

Repeat
  If KeyboardReleased(#PB_Key_Left)
    M3D_ShiftLeft(#Matrix1)
    M3D_UpDateVertex(#Matrix1)
    M3D_UpDateTexture(#Matrix1)
  ElseIf KeyboardReleased(#PB_Key_Right)
    M3D_ShiftRight(#Matrix1)
    M3D_UpDateVertex(#Matrix1)
    M3D_UpDateTexture(#Matrix1)
  ElseIf KeyboardReleased(#PB_Key_Down)
    M3D_ShiftDown(#Matrix1)
    M3D_UpDateVertex(#Matrix1)
    M3D_UpDateTexture(#Matrix1)  
  ElseIf KeyboardReleased(#PB_Key_Up)
    M3D_ShiftUp(#Matrix1)
    M3D_UpDateVertex(#Matrix1)
    M3D_UpDateTexture(#Matrix1)    
  EndIf  
  If ExamineKeyboard()
    If KeyboardReleased(#PB_Key_F1)
      Camera\Mode = #PB_Camera_Wireframe - Camera\Mode
      CameraRenderMode(0,Camera\Mode)
    EndIf 
  EndIf  
  RenderWorld()
  FlipBuffers()

Until KeyboardPushed(#PB_Key_Escape) 
End
 

DataSection
Hauteur:
Data.l 10,10,10,10,10
Data.l 10,11,11,11,10
Data.l 10,11,13,11,10
Data.l 10,11,11,11,10
Data.l 10,10,10,10,10
EndDataSection

Publié : sam. 19/juin/2004 10:49
par comtois
http://perso.wanadoo.fr/comtois/M3D_Mat ... 190604.zip

J'ai refait un pack complet avec les exemples et la démo de Filperj.

J'ai aussi ajouté M3D_RotateTexture() , utile pour orienter une texture sur une facette ( et pourquoi pas faire des animations sur une facette , en changeant de texture ,et en les tournant on doit pouvoir obtenir des effets intéressants ,par exemple quand une entity passe sur une dalle , elle pourrait changer , tourner , s'animer ).

Ajout de M3D_UpDateMAtrix() qui englobe
M3D_UpDateVertex(),M3D_UpDateTexture() et M3D_UpDateNormales()

maintenant il y a le choix :)

Bon , il me reste à changer l'entête des fichiers de sauvegarde.
et optimiser chaque fonction .

Pour la doc , je ne sais pas , ce n'est pas la partie la plus passionnante :)

Publié : dim. 20/juin/2004 14:18
par comtois
Mise à jour sur mon site => M3D_Matrix3D200604.zip

Le fichier fait 47 ko , et contient

La lib à jour avec
M3D_RandomizeMatrix(No,Hauteur) > Fixe une hauteur aléatoire de 0 à Hauteur à chaque vertex de la matrice.
M3D_SetMatrixHeight(No, Hauteur) > fixe la hauteur de toutes les facettes
M3D_GetNoTileTexture(No, X,Z) > Renvoie le No de la texture de la facette X,Z

Et j'ai ajouté un autre exemple avec Shift ,c'est plus concret , c'est presque un jeu :)

Publié : lun. 21/juin/2004 11:04
par comtois
Bon allez , c'est ma dernière annonce sur cette lib :)

Je la maintiendrai à jour ici :

http://perso.wanadoo.fr/comtois/M3D_Matrix3D.htm

Voila les dernières modifs

M3D_Matrix3D le 21 juin 2004

Ajout :
- M3D_AddColor()
- M3D_ColorFacette()
- M3D_SetVertexColor()
- M3D_UpdateColor()

Modification:
- M3D_UpdateMatrix() => Add UpdateColor()

Changement de nom :
M3D_MatrixTextureWidth() => M3D_TextureWidth()
M3D_MatrixTextureHeight() => M3D_TextureHeight()
M3D_MatrixNbTextureX() => M3D_NbTextureX()
M3D_MatrixNbTextureZ() => M3D_NbTextureZ()
M3D_MatrixNbFacetteX() => M3D_NbFacetteX()
M3D_MatrixNbFacetteZ(l) => M3D_NbFacetteZ()
M3D_MatrixFacetteWidth() => M3D_FacetteWidth()
M3D_MatrixFacetteHeight() => M3D_FacetteHeight()

Ajout exemples No9 et No10.

Publié : lun. 21/juin/2004 19:46
par filperj
Hé, quel beau boulot! Félicitations :D

Publié : lun. 21/juin/2004 22:45
par comtois
Merci , j'attends ta prochaine démo :)


[Edit]
J'en profite pour dire qu'il y a une erreur dans l'exemple No8
je corrigerai pour la prochaine mise à jour.

Il faut remplacer

Code : Tout sélectionner

M3D_RandomizeMatrix(#Matrix2, Random(350))
par

Code : Tout sélectionner

M3D_RandomizeMatrix(#Matrix2, 350)
voila maintenant je comprends mieux pourquoi j'avais parfois un plafond plat :oops: