diff options
author | nathansmithsmith <nathansmith7@mailfence.com> | 2023-09-18 21:46:39 -0600 |
---|---|---|
committer | nathansmithsmith <nathansmith7@mailfence.com> | 2023-09-18 21:46:39 -0600 |
commit | 7e49b327b5b06d5461dbc483a2d81a347150200c (patch) | |
tree | 702c1ddfb86bf8e6efeb3e20b09b99b70806cf0b | |
parent | 9d42d9dcc3b492951785b35e08f0851842d7d148 (diff) |
gyroscope working
-rw-r--r-- | src/gameScreen.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gameScreen.c b/src/gameScreen.c index a446f69..86b6a51 100644 --- a/src/gameScreen.c +++ b/src/gameScreen.c @@ -10,6 +10,7 @@ void initGameScreenGui(GameScreen * gameScreen) { // It is kind of terrible but works. gameScreen->infoText = (Vector2){0.0, height / 1.5}; + gameScreen->gyroscopePosition = (Vector2){ (width / 2.0) - (GYROSCOPE_TEXTURE_SIZE / 2.0), height / 1.8 @@ -35,7 +36,7 @@ void initGameScreen(GameScreen * gameScreen) { ); // Load model. - Mesh mesh = GenMeshSphere(1.0, 4, 4); + Mesh mesh = GenMeshSphere(1.0, 8, 8); gameScreen->gyroscopeModel = LoadModelFromMesh(mesh); } @@ -73,7 +74,11 @@ void drawGyroscope(Game * game) { ClearBackground(BLACK); BeginMode3D(gameScreen->gyroscopeCamaera); - DrawSphereWires(Vector3Zero(), 1.0, 8, 8, GREEN); + //DrawSphereWires(Vector3Zero(), 1.0, 8, 8, GREEN); + + gameScreen->gyroscopeModel.transform = QuaternionToMatrix(QuaternionInvert(player->rotation)); + + DrawModelWires(gameScreen->gyroscopeModel, Vector3Zero(), 1, GREEN); EndMode3D(); EndTextureMode(); |