Outils pour utilisateurs

Outils du site


playground:skybox

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:skybox [2017/05/11 18:20] falsamplayground:skybox [2018/01/11 01:57] falsam
Ligne 9: Ligne 9:
  
 IncludeFile "babylon/babylon.sbi" IncludeFile "babylon/babylon.sbi"
- +Enumeration 
-Global Camera, Light0, Light1, Sky, Ground, MatGround, Torus0, Torus1, ShadowGenerator+  #mf 
 +  #mfRender 
 +EndEnumeration 
 +Global Camera, Light0, Light1, Sky, Ground, TexGround, MatGround, Torus0, Torus1, ShadowGenerator
  
 Declare LoadGame() Declare LoadGame()
Ligne 16: Ligne 19:
  
 UseModule BJS UseModule BJS
 +OpenWindow(#mf, 0, 0, 0, 0 ,"", #PB_Window_Background)
 +CanvasGadget(#mfRender, 0, 0, WindowWidth(#mf), WindowHeight(#mf), #PB_Canvas_Transparent)
  
-InitEngine(@LoadGame())+InitEngine(@LoadGame(), #mfRender)
  
 Procedure LoadGame()    Procedure LoadGame()   
 +  Protected n
   If CreateScene()   If CreateScene()
-    Camera = CreateCamera("camera", 0, 20, -80, #ArcRotate)+         
 +    Camera = CreateCamera("camera", 0, 20, -80, #BJS_ArcRotate)
          
-    Light0 = CreateLight("light0", 0, 30, 0, 0.6, #Point+    Light0 = CreateLight("light0", 0, 30, 0, 0.6, #BJS_Point
-    Light1 = CreateLight("light1", 0, 30, 0, 0.2, #Hemispheric)+    Light1 = CreateLight("light1", 0, 30, 0, 0.2, #BJS_Hemispheric)
          
     ;SkyBox     ;SkyBox
Ligne 31: Ligne 38:
     ;Ground     ;Ground
     Ground = CreateGround("Ground", 1000, 1000)     Ground = CreateGround("Ground", 1000, 1000)
-    MatGround CreateMaterial("Grass", "data/textures/grass1.jpg")+    TexGround LoadTexture("Grass", "data/textures/grass1.jpg"
 +    MatGround = CreateMaterial("Grass"
 +    SetMaterialTexture(MatGround, #BJS_Diffuse, TexGround)
     ScaleMaterial(MatGround, 40, 40)     ScaleMaterial(MatGround, 40, 40)
-    SetMaterial(Ground, MatGround)+    SetMeshMaterial(Ground, MatGround)
          
     ;Torus     ;Torus
Ligne 47: Ligne 56:
     ShadowEmitter(Torus1)     ShadowEmitter(Torus1)
     RenderShadows(Ground, #True)     RenderShadows(Ground, #True)
-       +   
     RenderLoop(@RenderGame())     RenderLoop(@RenderGame())
   EndIf   EndIf
Ligne 53: Ligne 62:
  
 Procedure RenderGame() Procedure RenderGame()
-  RotateMesh(Torus0, 0.01, 0.00, 0.02, #PB_Relative) +  RotateMesh(Torus0, 0.5, 0.00, 0.5, #PB_Relative) 
-  RotateMesh(Torus1, 0.020.01, 0.00, #PB_Relative)+  RotateMesh(Torus1, 1, 1, 0.00, #PB_Relative)
      
   If GetCameraBeta(Camera) > 1.50   If GetCameraBeta(Camera) > 1.50
playground/skybox.txt · Dernière modification : 2023/03/15 15:49 de 127.0.0.1