;Babylon.sbi - Material EnableExplicit IncludeFile "babylon/babylon.sbi" Global Camera, Light, Plane, Sphere, MatPlane, MatSphere Declare LoadGame() Declare RenderGame() UseModule BJS InitEngine(@LoadGame()) Procedure LoadGame() If CreateScene() ;Camera & Light Camera = CreateCamera("camera", 0, 5, 7, #BJS_ArcRotate) Light = CreateLight("light", 0, 10, 0, 1, #BJS_Hemispheric) ;Object Plane = CreateGround("plane", 10, 10) Sphere = CreateSphere("sphere", 2) MoveMesh(Sphere, 0, 2, 0) ;Material MatPlane = CreateMaterial("MatPlane", "data/textures/grass.jpg") ScaleMaterial(MatPlane, 5, 5) MatSphere = CreateMaterial("MatPlane", "data/textures/tree.png") ;Apply material SetMaterial(Plane, MatPlane) SetMaterial(Sphere, MatSphere) RenderLoop(@RenderGame()) EndIf EndProcedure Procedure RenderGame() RotateMesh(Sphere, 0, 0.01, 0, #PB_Relative) RenderWorld() EndProcedure