-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenGLAxis.cpp
More file actions
52 lines (41 loc) · 1.05 KB
/
OpenGLAxis.cpp
File metadata and controls
52 lines (41 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// OpenGLAxis.cpp
// OpenGLTutorial
//
// Created by Robby Tong on 1/7/19.
// Copyright © 2019 Robby Tong. All rights reserved.
//
#include "OpenGLAxis.hpp"
OpenGLAxis::OpenGLAxis():
OpenGLComposite()
{
mXAxis = new OpenGLArrow(OpenGLPrimitive::COLOR_RED);
mYAxis = new OpenGLArrow(OpenGLPrimitive::COLOR_GREEN);
mZAxis = new OpenGLArrow(OpenGLPrimitive::COLOR_BLUE);
mXAxis->setOrientation(-90, ROTATION_ZAXIS);
mZAxis->setOrientation(+90, ROTATION_XAXIS);
mXAxis->addPosition(0.0, 0.0, 0.0);
mYAxis->addPosition(0.0, 0.0, 0.0);
mZAxis->addPosition(0.0, 0.0, 0.0);
this->addDrawable(mXAxis);
this->addDrawable(mYAxis);
this->addDrawable(mZAxis);
}
OpenGLAxis::~OpenGLAxis()
{
delete mXAxis;
delete mYAxis;
delete mZAxis;
}
void OpenGLAxis::setXMagnitude(float length)
{
mXAxis->setScale(1.0, length, 1.0);
}
void OpenGLAxis::setYMagnitude(float length)
{
mYAxis->setScale(1.0, length, 1.0);
}
void OpenGLAxis::setZMagnitude(float length)
{
mZAxis->setScale(1.0, length, 1.0);
}