playground:picking
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| playground:picking [2017/04/30 19:04] – falsam | playground:picking [2023/03/15 15:49] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | **12-picking.sb** | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | <file purebasic 12-picking.sb> | ||
| + | ; | ||
| + | |||
| + | EnableExplicit | ||
| + | |||
| + | IncludeFile " | ||
| + | |||
| + | Declare LoadGame() | ||
| + | Declare RenderGame() | ||
| + | |||
| + | UseModule BJS | ||
| + | |||
| + | InitEngine(@LoadGame()) | ||
| + | |||
| + | Procedure LoadGame() | ||
| + | Protected Mesh | ||
| + | | ||
| + | If CreateScene() | ||
| + | CreateCamera(" | ||
| + | | ||
| + | CreateLight(" | ||
| + | | ||
| + | CreateGround(" | ||
| + | Mesh = CreateBox(" | ||
| + | MoveMesh(Mesh, | ||
| + | | ||
| + | Mesh = CreateSphere(" | ||
| + | MoveMesh(Mesh, | ||
| + | | ||
| + | Mesh = CreateCylinder(" | ||
| + | MoveMesh(Mesh, | ||
| + | | ||
| + | ;Active le systeme de picking | ||
| + | PickEnable() | ||
| + | | ||
| + | RenderLoop(@RenderGame()) | ||
| + | EndIf | ||
| + | EndProcedure | ||
| + | |||
| + | Procedure RenderGame() | ||
| + | Protected Mesh = IsPick() | ||
| + | | ||
| + | If Mesh | ||
| + | Debug "Name " + GetMeshName(PickMesh()) | ||
| + | Debug " | ||
| + | Debug "x/y/z " + StrD(PickX(), | ||
| + | | ||
| + | EndIf | ||
| + | | ||
| + | RenderWorld() | ||
| + | EndProcedure | ||
| + | </ | ||
