playground:light
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| playground:light [2017/05/09 00:48] – créée falsam | playground:light [2023/03/15 15:49] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | **04-Light.sb** | ||
| + | [[http:// | ||
| + | |||
| + | <file purebasic 04-light.sb> | ||
| + | ; | ||
| + | |||
| + | EnableExplicit | ||
| + | |||
| + | IncludeFile " | ||
| + | UseModule BJS | ||
| + | |||
| + | Global Scene, Camera, Light0, Light1, Light2, Ligh3, Mesh, Texture, Material | ||
| + | |||
| + | Declare LoadGame() | ||
| + | Declare RenderGame() | ||
| + | |||
| + | InitEngine(@LoadGame()) | ||
| + | |||
| + | Procedure LoadGame() | ||
| + | Scene = CreateScene() | ||
| + | If Scene | ||
| + | Camera = CreateCamera(" | ||
| + | | ||
| + | ;Lights | ||
| + | CreateLight(" | ||
| + | | ||
| + | Light0 = CreateLight(" | ||
| + | SpotLightRange(Light0, | ||
| + | SetLightColor(Light0, | ||
| + | SetLightColor(Light0, | ||
| + | | ||
| + | Light1 = CreateLight(" | ||
| + | SpotLightRange(Light1, | ||
| + | SetLightColor(Light1, | ||
| + | SetLightColor(Light1, | ||
| + | | ||
| + | Light2 = CreateLight(" | ||
| + | SpotLightRange(Light2, | ||
| + | SetLightColor(Light2, | ||
| + | SetLightColor(Light2, | ||
| + | | ||
| + | ;Ground & Box | ||
| + | Texture = LoadTexture(" | ||
| + | Material = CreateMaterial(" | ||
| + | SetMaterialTexture(Material, | ||
| + | Mesh = CreateGround(" | ||
| + | SetMeshMaterial(Mesh, | ||
| + | ScaleMaterial(Material, | ||
| + | | ||
| + | Texture = LoadTexture(" | ||
| + | Material = CreateMaterial(" | ||
| + | SetMaterialTexture(Material, | ||
| + | SetMaterialColor(Material, | ||
| + | Mesh = CreateBox(" | ||
| + | SetMeshMaterial(Mesh, | ||
| + | MoveMesh(Mesh, | ||
| + | | ||
| + | RenderLoop(@RenderGame()) | ||
| + | EndIf | ||
| + | EndProcedure | ||
| + | |||
| + | Procedure RenderGame() | ||
| + | RenderWorld() | ||
| + | EndProcedure | ||
| + | </ | ||
