diff options
| author | raysan5 <raysan5@gmail.com> | 2013-12-20 13:21:22 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2013-12-20 13:21:22 +0100 |
| commit | 4df2c5e06e21c905506bc8d5d026428875102176 (patch) | |
| tree | 392af68c0fafc307b72902ba8b87e7842a2e96cd /examples | |
| parent | 907fb14c797c3bfcf8c9e9d46c9280c056146088 (diff) | |
| download | raylib-4df2c5e06e21c905506bc8d5d026428875102176.tar.gz raylib-4df2c5e06e21c905506bc8d5d026428875102176.zip | |
Updated example ex07b_3d_shapes
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/ex07b_3d_shapes.c | 28 | ||||
| -rw-r--r-- | examples/ex07b_3d_shapes.exe | bin | 0 -> 346234 bytes | |||
| -rw-r--r-- | examples/ex07b_3d_shapes.png | bin | 3913 -> 24134 bytes |
3 files changed, 13 insertions, 15 deletions
diff --git a/examples/ex07b_3d_shapes.c b/examples/ex07b_3d_shapes.c index 9843b257..af6ad837 100644 --- a/examples/ex07b_3d_shapes.c +++ b/examples/ex07b_3d_shapes.c @@ -18,8 +18,6 @@ int main() int screenWidth = 800; int screenHeight = 450; - Vector3 position = { 0.0, 0.0, 0.0 }; - // Define the camera to look into our 3d world Camera camera = {{ 0.0, 10.0, 10.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }}; @@ -44,20 +42,20 @@ int main() Begin3dMode(camera); - DrawCube(position, 2, 2, 2, RED); // Draw a cube - DrawCubeWires(position, 2, 2, 2, MAROON); // Draw a wired-cube + DrawCube((Vector3){-4, 0, 2}, 2, 5, 2, RED); + DrawCubeWires((Vector3){-4, 0, 2}, 2, 5, 2, GOLD); + DrawCubeWires((Vector3){-4, 0, -2}, 3, 6, 2, MAROON); + + DrawSphere((Vector3){-1, 0, -2}, 1, GREEN); + DrawSphereWires((Vector3){1, 0, 2}, 2, LIME); - // TODO: Draw some basic 3d shapes -/* -void DrawCube(Vector3 position, float width, float height, float lenght, Color color); -void DrawCubeV(Vector3 position, Vector3 size, Color color); -void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); -void DrawSphere(Vector3 centerPos, float radius, Color color); -void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); -void DrawSphereWires(Vector3 centerPos, float radius, Color color); -void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); -void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); -*/ + DrawCylinder((Vector3){4, 0, -2}, 1, 2, 3, 4, SKYBLUE); + DrawCylinderWires((Vector3){4, 0, -2}, 1, 2, 3, 4, DARKBLUE); + DrawCylinderWires((Vector3){4.5, -1, 2}, 1, 1, 2, 6, BROWN); + + DrawCylinder((Vector3){1, 0, -4}, 0, 1.5, 3, 8, GOLD); + DrawCylinderWires((Vector3){1, 0, -4}, 0, 1.5, 3, 8, PINK); + DrawGrid(10.0, 1.0); // Draw a grid End3dMode(); diff --git a/examples/ex07b_3d_shapes.exe b/examples/ex07b_3d_shapes.exe Binary files differnew file mode 100644 index 00000000..5f10ed88 --- /dev/null +++ b/examples/ex07b_3d_shapes.exe diff --git a/examples/ex07b_3d_shapes.png b/examples/ex07b_3d_shapes.png Binary files differindex f18ae044..febc421e 100644 --- a/examples/ex07b_3d_shapes.png +++ b/examples/ex07b_3d_shapes.png |
