Outils pour utilisateurs

Outils du site


playground:terrain

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Dernière révisionLes deux révisions suivantes
playground:terrain [2017/05/11 18:14] falsamplayground:terrain [2018/01/11 01:58] falsam
Ligne 17: Ligne 17:
 IncludeFile "babylon/babylon.sbi" IncludeFile "babylon/babylon.sbi"
  
-Global Camera, Light, Sky, Ground, GroundMat, Water, Box, Mesh, Material+Global Camera, Light, Sky, Ground, GroundTex, GroundMat, Water, Box, Mesh, Texture, Material
 Global Box0, Box1, Box2 Global Box0, Box1, Box2
  
Ligne 32: Ligne 32:
          
     ;Camera & Light     ;Camera & Light
-    Camera = CreateCamera("camera", 0, 65, 100, #Free)+    Camera = CreateCamera("camera", 0, 65, 100, #BJS_Universal)
     CameraBodySize(Camera, 1, 15, 1)     CameraBodySize(Camera, 1, 15, 1)
     CameraLookAt(Camera, 0, 30, 0)     CameraLookAt(Camera, 0, 30, 0)
Ligne 40: Ligne 40:
     CameraMapKey(Camera, #PB_Key_Right, #PB_Key_Z)        CameraMapKey(Camera, #PB_Key_Right, #PB_Key_Z)   
                  
-    Light = CreateLight("Light", 0, 200, -100, 0.8, #Point)+    Light = CreateLight("Light", 0, 200, -100, 0.8, #BJS_Point)
                  
     ;SkyBox     ;SkyBox
Ligne 47: Ligne 47:
     ;Terrain     ;Terrain
     Ground = CreateTerrain("island", "data/textures/heightMap.png", 1000, 1000, 210, 0, 70)     Ground = CreateTerrain("island", "data/textures/heightMap.png", 1000, 1000, 210, 0, 70)
-    GroundMat CreateMaterial("sand", "data/textures/Ground.jpg")+    GroundTex LoadTexture("sand", "data/textures/Ground.jpg"
 +    GroundMat = CreateMaterial("sand"
 +    SetMaterialTexture(GroundMat, #BJS_Diffuse, GroundTex)
     ScaleMaterial(GroundMat, 16, 16)     ScaleMaterial(GroundMat, 16, 16)
-    SetMaterial(Ground, GroundMat) +    SetMeshMaterial(Ground, GroundMat) 
-    SetMaterialColor(GroundMat, #SpecularRGBA(000, 255))+    SetMaterialColor(GroundMat, #BJS_SpecularRGB(808080))
     MoveMesh(Ground, 0, -12, 0)     MoveMesh(Ground, 0, -12, 0)
          
     ;Box     ;Box
-    Box0 = CreateBox("box", 10) +    Box0 = CreateBox("box", 10, 10, 10) 
-    Material CreateMaterial("box", "data/textures/crate.png"+    Texture LoadTexture("box", "data/textures/crate.png"
-    SetMaterial(Box0, Material)+    Material = CreateMaterial("box"
 +    SetMaterialTexture(Material, #BJS_Diffuse, Texture) 
 +    SetMaterialColor(Material, #BJS_Emissive, RGB(80, 80, 80)) 
 +    SetMeshMaterial(Box0, Material)
     MoveMesh(Box0, -4, 22, -70)     MoveMesh(Box0, -4, 22, -70)
     Box1 = CloneMesh(Box0)     Box1 = CloneMesh(Box0)
Ligne 80: Ligne 85:
 EndProcedure EndProcedure
  
-Procedure RenderGame()     +Procedure RenderGame()   
   If KeyPushed(#PB_Key_Left)   If KeyPushed(#PB_Key_Left)
     RotateCamera(Camera, 0, -0.05, 0, #PB_Relative)     RotateCamera(Camera, 0, -0.05, 0, #PB_Relative)
playground/terrain.txt · Dernière modification : 2023/03/15 15:49 de 127.0.0.1