playground:material
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| playground:material [2017/04/28 22:03] – modification externe 127.0.0.1 | playground:material [2023/03/15 15:49] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | **02-Material.sb** | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | <file purebasic 02-Material.sb> | ||
| + | ; | ||
| + | |||
| + | EnableExplicit | ||
| + | |||
| + | IncludeFile " | ||
| + | |||
| + | Global Camera, Light, Plane, Sphere, MatPlane, MatSphere | ||
| + | |||
| + | Declare LoadGame() | ||
| + | Declare RenderGame() | ||
| + | |||
| + | UseModule BJS | ||
| + | |||
| + | InitEngine(@LoadGame()) | ||
| + | |||
| + | Procedure LoadGame() | ||
| + | If CreateScene() | ||
| + | | ||
| + | ;Camera & Light | ||
| + | Camera | ||
| + | Light = CreateLight(" | ||
| + | | ||
| + | ;Object | ||
| + | Plane = CreateGround(" | ||
| + | | ||
| + | Sphere | ||
| + | MoveMesh(Sphere, | ||
| + | | ||
| + | ;Material | ||
| + | MatPlane = CreateMaterial(" | ||
| + | ScaleMaterial(MatPlane, | ||
| + | | ||
| + | MatSphere = CreateMaterial(" | ||
| + | | ||
| + | ;Apply material | ||
| + | SetMaterial(Plane, | ||
| + | SetMaterial(Sphere, | ||
| + | |||
| + | RenderLoop(@RenderGame()) | ||
| + | EndIf | ||
| + | EndProcedure | ||
| + | |||
| + | Procedure RenderGame() | ||
| + | RotateMesh(Sphere, | ||
| + | RenderWorld() | ||
| + | EndProcedure</ | ||
| + | |||
