Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Luis Penaranda
panoramic
Commits
09c102a7
Commit
09c102a7
authored
Sep 06, 2013
by
Luis Penaranda
Browse files
added perspective visualization
parent
d2c03e50
Changes
2
Hide whitespace changes
Inline
Side-by-side
openglcanvas.cpp
View file @
09c102a7
...
...
@@ -425,7 +425,7 @@ void OpenGLCanvas::vertex_transformation(float *positions, int m, int n, float c
lambda
=
atan2f
(
x
,
-
z
)
/
CONST_PI_F
;
phi
=
asinf
(
y
)
/
CONST_PI_2_F
;
if
(
visualization
==
"Moebius"
){
if
(
visualization
==
"Moebius"
||
visualization
==
"Perspective"
){
u
=
x
/
(
-
z
);
v
=
y
/
(
-
z
);
positions
[
3
*
(
j
+
i
*
n
)]
=
u
/
extent
;
...
...
@@ -535,7 +535,7 @@ float OpenGLCanvas::calculate_extent(float fov_rads){
x
=
(
4.
f
*
u
)
/
(
u
*
u
+
v
*
v
+
4.
f
);
y
=
(
4.
f
*
v
)
/
(
u
*
u
+
v
*
v
+
4.
f
);
z
=
(
u
*
u
+
v
*
v
-
4.
f
)
/
(
u
*
u
+
v
*
v
+
4.
f
);
if
(
visualization
==
"Moebius"
){
if
(
visualization
==
"Moebius"
||
visualization
==
"Perspective"
){
u
=
x
/
(
-
z
);
v
=
y
/
(
-
z
);
}
...
...
@@ -774,7 +774,7 @@ void OpenGLCanvas::paintGL(){
// defining transformation parameters (that will be passed to the vertex shader)
float
extent
=
calculate_extent
(
fov_rads
);
float
vis_mode
=
.0
f
;
if
(
visualization
==
"Moebius"
)
vis_mode
=
1.
f
;
if
(
visualization
==
"Moebius"
||
visualization
==
"Perspective"
)
vis_mode
=
1.
f
;
else
if
(
visualization
==
"3D Sphere"
)
vis_mode
=
2.
f
;
else
if
(
visualization
==
"Equi-Rectangular"
)
vis_mode
=
3.
f
;
else
if
(
visualization
==
"Stereographic"
)
vis_mode
=
4.
f
;
...
...
panowindow1.ui
View file @
09c102a7
...
...
@@ -192,6 +192,11 @@
<string>
Equi-Rectangular
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Perspective
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Stereographic
</string>
...
...
@@ -199,17 +204,17 @@
</item>
<item>
<property
name=
"text"
>
<string>
Mercator
</string>
<string>
Orthographic
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Zorin-Bar
r
</string>
<string>
Mercato
r
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Orthographic
</string>
<string>
Zorin-Barr
</string>
</property>
</item>
</widget>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment