Commit e5a95c53 by Kai Westerkamp

add Glut and Torus

parent fc71d062
......@@ -24,6 +24,9 @@ void Controler::mousePressed(GLView* view, QMouseEvent *event)
void Controler::mouseMoveEvent(GLView* view, QMouseEvent *event)
{
if(activeView != view)
qDebug()<<"Active view Change";
if (event->buttons() & Qt::LeftButton) {
rotate(trackballPoint(event->pos().x(),event->pos().y()));
event->accept();
......
This diff is collapsed. Click to expand it.
......@@ -11,6 +11,9 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = hellocube
TEMPLATE = app
LIBS += -lglut64
LIBS += -L$$PWD/glut
SOURCES += main.cpp\
mainwindow.cpp \
cubewidget.cpp \
......@@ -30,7 +33,8 @@ HEADERS += mainwindow.h \
camera.h \
sceneprimitive.h \
sceneobject.h \
scenenode.h
scenenode.h \
glut.h
RESOURCES += \
hellocube.qrc
......
......@@ -19,7 +19,7 @@ int Scene::simpleScene()
moveActive(QVector3D(0,1.5,-1.5));
addTorus();
moveActive(QVector3D(-1.5,0,0));
moveActive(QVector3D(0,0,-3));
addCone();
moveActive(QVector3D(0,-1.5,-1.5));
......
......@@ -93,7 +93,7 @@ void ScenePrimitive::draw(){
gluDisk( qobj, 0.0, radius, tesselation, 1);
break;
case Torus:
// glutSolidTorus(5, 15, 8, 128);
glutSolidTorus(1, 2, tesselation, tesselation);
break;
default:
qDebug()<<"Enum Error";
......
......@@ -2,6 +2,7 @@
#define SCENEPRIMITIVE_H
#include <sceneobject.h>
#include <glut.h>
enum PrimitiveType{Quader=0,Sphere,Cylinder,Torus,Cone};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment