summaryrefslogtreecommitdiffstats
path: root/dev/snowman/snowman.cc
diff options
context:
space:
mode:
authorunknown <paulx161@umn.edu>2021-02-04 18:37:17 -0600
committerunknown <paulx161@umn.edu>2021-02-04 18:37:17 -0600
commitfee4cbf40b07e17eca676b4687c51313f7cfdd2e (patch)
treec3e668b7e76a7f293806f897ae88b4a2dcb254b8 /dev/snowman/snowman.cc
parentadded dev/MinGfx/ (diff)
downloadcsci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar
csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.gz
csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.bz2
csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.lz
csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.xz
csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.zst
csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.zip
Added example projects from lecture
Diffstat (limited to 'dev/snowman/snowman.cc')
-rw-r--r--dev/snowman/snowman.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/dev/snowman/snowman.cc b/dev/snowman/snowman.cc
new file mode 100644
index 0000000..77ffa4d
--- /dev/null
+++ b/dev/snowman/snowman.cc
@@ -0,0 +1,48 @@
+/** CSci-4611 In-Class Example */
+
+#include "snowman.h"
+
+#include <iostream>
+#include <sstream>
+
+
+
+Snowman::Snowman() : GraphicsApp(1024,768, "Do You Want to Build a Snowman?") {
+}
+
+
+Snowman::~Snowman() {
+}
+
+
+void Snowman::UpdateSimulation(double dt) {
+}
+
+
+void Snowman::InitOpenGL() {
+ // Set up the camera in a good position to see the entire scene
+ proj_matrix_ = Matrix4::Perspective(60.0f, aspect_ratio(), 0.01f, 100.0f);
+ view_matrix_ = Matrix4::LookAt(Point3(0,2,10), Point3(0,0,0), Vector3(0,1,0));
+ glClearColor(0.2f, 0.6f, 1.0f, 1.0f);
+}
+
+
+void Snowman::DrawUsingOpenGL() {
+ Matrix4 identity;
+
+ // draws a set of axes at the world origin, since we are passing the identity
+ // matrix for the "model" matrix.
+ quick_shapes_.DrawAxes(identity, view_matrix_, proj_matrix_);
+
+
+ Matrix4 S_ground = Matrix4::Scale(Vector3(40.0f, 0.2f, 40.0f));
+ Matrix4 T_ground = Matrix4::Translation(Vector3(0.0f, -0.2f, 0.0f));
+ Matrix4 ground_combo = T_ground * S_ground;
+ quick_shapes_.DrawCube(ground_combo, view_matrix_, proj_matrix_, Color(0.8f, 0.8f, 0.8f));
+
+}
+
+
+
+
+