Permalink
Browse files

added code from last year (Allegany 2011!)

  • Loading branch information...
0 parents commit cc1d96a8e3e43eb1acd62ceb37f7ba357dcc8def @metadave committed Feb 24, 2012
@@ -0,0 +1,39 @@
+QT += opengl
+CONFIG += qt
+
+HEADERS += \
+ src/FluxObjParser.h \
+ src/FluxWindow.h \
+ src/FluxCore.h \
+ src/FluxGLWidget.h \
+ src/FluxInputStateStack.h \
+ src/FluxContext.h \
+ src/FluxInputHandler.h \
+ src/FluxSelection.h \
+ src/FluxCommon.h \
+ src/FluxSceneRenderer.h \
+ src/FluxDefaultInputHandler.h \
+ src/FluxModelOps.h \
+ src/FluxOptions.h \
+ src/FluxMath3d.h \
+ src/FluxGraphicsView.h
+
+SOURCES += \
+ src/FluxObjParser.cpp \
+ src/main.cpp \
+ src/FluxWindow.cpp \
+ src/FluxCore.cpp \
+ src/FluxGLWidget.cpp \
+ src/FluxInputStateStack.cpp \
+ src/FluxContext.cpp \
+ src/FluxInputHandler.cpp \
+ src/FluxSelection.cpp \
+ src/FluxSceneRenderer.cpp \
+ src/FluxDefaultInputHandler.cpp \
+ src/FluxModelOps.cpp \
+ src/FluxOptions.cpp \
+ src/FluxMath3d.cpp \
+ src/FluxGraphicsView.cpp
+
+OTHER_FILES += \
+ README.txt

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,10 @@
+Some of the 3d modeler I was working on last year. C++ w/ old school OpenGL.
+
+
+Ctrl-Left mouse rotates scene
+Ctrl-Right mouse drags scene
+Ctrl-Mousewheel zooms in and out
+
+Spacebar deselects all
+
+I would like to convert this to WebGL + CoffeeScript (or maybe even Racket).
@@ -0,0 +1 @@
+c:\tools\astyle\bin\astyle --style=java --align-pointer=type --break-blocks .\src\*.cpp .\src\*.h
@@ -0,0 +1,10 @@
+# Exported from Wings 3D 1.2
+newmtl default
+Ns 100.0
+d 1.0
+illum 2
+Kd 1.0 1.0 1.0
+Ka 1.0 1.0 1.0
+Ks 1.0 1.0 1.0
+Ke 0.0 0.0 0.0
+
@@ -0,0 +1,86 @@
+# Exported from Wings 3D 1.2
+mtllib grid.mtl
+o grid1
+#29 vertices, 21 faces
+v -1.00000000 0.10000000 -1.00000000
+v -0.50000000 0.10000000 -1.00000000
+v 0.0000000e+0 0.10000000 -1.00000000
+v 0.50000000 0.10000000 -1.00000000
+v 1.00000000 0.10000000 -1.00000000
+v -1.00000000 0.10000000 -0.50000000
+v -0.50000000 0.10000000 -0.50000000
+v 0.0000000e+0 0.10000000 -0.50000000
+v 0.50000000 0.10000000 -0.50000000
+v 1.00000000 0.10000000 -0.50000000
+v -1.00000000 0.10000000 0.0000000e+0
+v -0.50000000 0.10000000 0.0000000e+0
+v 0.0000000e+0 0.10000000 0.0000000e+0
+v 0.50000000 0.10000000 0.0000000e+0
+v 1.00000000 0.10000000 0.0000000e+0
+v -1.00000000 0.10000000 0.50000000
+v -0.50000000 0.10000000 0.50000000
+v 0.0000000e+0 0.10000000 0.50000000
+v 0.50000000 0.10000000 0.50000000
+v 1.00000000 0.10000000 0.50000000
+v -1.00000000 0.10000000 1.00000000
+v -0.50000000 0.10000000 1.00000000
+v 0.0000000e+0 0.10000000 1.00000000
+v 0.50000000 0.10000000 1.00000000
+v 1.00000000 0.10000000 1.00000000
+v -1.00000000 -0.10000000 -1.00000000
+v 1.00000000 -0.10000000 -1.00000000
+v -1.00000000 -0.10000000 1.00000000
+v 1.00000000 -0.10000000 1.00000000
+vn -0.57735027 0.57735027 -0.57735027
+vn 0.0000000e+0 0.89442719 -0.44721360
+vn 0.0000000e+0 0.89442719 -0.44721360
+vn 0.0000000e+0 0.89442719 -0.44721360
+vn 0.57735027 0.57735027 -0.57735027
+vn -0.44721360 0.89442719 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.44721360 0.89442719 0.0000000e+0
+vn -0.44721360 0.89442719 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.44721360 0.89442719 0.0000000e+0
+vn -0.44721360 0.89442719 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.0000000e+0 1.00000000 0.0000000e+0
+vn 0.44721360 0.89442719 0.0000000e+0
+vn -0.57735027 0.57735027 0.57735027
+vn 0.0000000e+0 0.89442719 0.44721360
+vn 0.0000000e+0 0.89442719 0.44721360
+vn 0.0000000e+0 0.89442719 0.44721360
+vn 0.57735027 0.57735027 0.57735027
+vn -0.57735027 -0.57735027 -0.57735027
+vn 0.57735027 -0.57735027 -0.57735027
+vn -0.57735027 -0.57735027 0.57735027
+vn 0.57735027 -0.57735027 0.57735027
+g grid1_default
+usemtl default
+s 1
+f 1//1 6//6 7//7 2//2
+f 1//1 26//26 28//28 21//21 16//16 11//11 6//6
+f 2//2 3//3 4//4 5//5 27//27 26//26 1//1
+f 2//2 7//7 8//8 3//3
+f 3//3 8//8 9//9 4//4
+f 4//4 9//9 10//10 5//5
+f 6//6 11//11 12//12 7//7
+f 7//7 12//12 13//13 8//8
+f 8//8 13//13 14//14 9//9
+f 9//9 14//14 15//15 10//10
+f 10//10 15//15 20//20 25//25 29//29 27//27 5//5
+f 11//11 16//16 17//17 12//12
+f 12//12 17//17 18//18 13//13
+f 13//13 18//18 19//19 14//14
+f 14//14 19//19 20//20 15//15
+f 16//16 21//21 22//22 17//17
+f 17//17 22//22 23//23 18//18
+f 18//18 23//23 24//24 19//19
+f 19//19 24//24 25//25 20//20
+f 21//21 28//28 29//29 25//25 24//24 23//23 22//22
+f 27//27 29//29 28//28 26//26
@@ -0,0 +1,10 @@
+#ifndef FLUXCOMMON_H
+#define FLUXCOMMON_H
+
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+#endif // FLUXCOMMON_H
+
+
@@ -0,0 +1,146 @@
+#include "FluxCore.h"
+#include "FluxContext.h"
+#include "FluxSceneRenderer.h"
+#include "FluxDefaultInputHandler.h"
+#include "FluxSceneRenderer.h"
+#include "FluxInputStateStack.h"
+#include "FluxOptions.h"
+
+Context::Context() {
+ scene = new Scene();
+ inputHandler = new FluxEventHandlers::DefaultInputHandler(this);
+ sceneRenderer = new SceneRenderer();
+ options = new Options();
+}
+
+Context::~Context() {
+ delete scene;
+ delete inputHandler;
+ delete sceneRenderer;
+ delete options;
+}
+
+Scene* Context::getScene() {
+ return scene;
+}
+
+InputHandler* Context::getInputHandler() {
+ return inputHandler;
+}
+
+SceneRenderer* Context::getSceneRenderer() {
+ return sceneRenderer;
+}
+
+
+Options* Context::getApplicationOptions() {
+ return options;
+}
+
+
+
+
+Scene::Scene() {
+ SceneView* sv = createSceneView();
+ activeSceneView = sv;
+}
+
+Scene::~Scene() {
+ foreach(Object3d* so,sceneObjects) {
+ delete so;
+ }
+ foreach(SceneView* sv, sceneViews) {
+ delete sv;
+ }
+}
+
+void Scene::addSceneObject(Object3d* so) {
+ sceneObjects.append(so);
+ qDebug("Setting active so");
+ activeSceneObject = so;
+}
+
+QList<Object3d*> Scene::getSceneObjects() {
+ return sceneObjects;
+}
+
+
+SceneView* Scene::getActiveSceneView() {
+ return activeSceneView;
+}
+
+SceneView* Scene::createSceneView() {
+ SceneView* sv = new SceneView(sceneViews.length());
+ sceneViews.append(sv);
+ return sv;
+}
+
+void Scene::setActiveGLWidget(FluxGLWidget* gl) {
+ activeGLWidget = gl;
+}
+
+FluxGLWidget* Scene::getActiveGLWidget() {
+ return activeGLWidget;
+}
+
+
+
+SceneView::SceneView(int newid) : id(newid) {
+ this->location = new V3(0.0,0.0,0.0);
+ this->rotation = new V3(0.0,0.0,0.0);
+ inputStateStack = new InputStateStack();
+ this->selectionMode = smVerts;
+ this->geomManipMode = gmmTranslate;
+}
+
+SceneView::~SceneView() {
+ delete location;
+ delete rotation;
+ delete inputStateStack;
+}
+
+
+Object3d* SceneView::getActiveSceneObject() {
+ return activeSceneObject;
+}
+
+void SceneView::setActiveSceneObject(Object3d* o) {
+ activeSceneObject = o;
+}
+
+V3* SceneView::getLocation() {
+ return location;
+}
+
+V3* SceneView::getRotation() {
+ return rotation;
+}
+
+double SceneView::getScale() {
+ return scale;
+}
+
+void SceneView::setScale(double d) {
+ scale = d;
+}
+
+InputStateStack* SceneView::getInputStateStack() {
+ return inputStateStack;
+}
+
+SelectionMode SceneView::getSelectionMode() {
+ return selectionMode;
+}
+
+void SceneView::setSelectionMode(SelectionMode newMode) {
+ selectionMode = newMode;
+}
+
+
+GeomManipMode SceneView::getGeomManipMode() {
+ return geomManipMode;
+}
+
+void SceneView::setGeomManipMode(GeomManipMode mode) {
+ geomManipMode = mode;
+}
Oops, something went wrong.

0 comments on commit cc1d96a

Please sign in to comment.