Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Luis Penaranda
/
panoramic
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dade31c1
authored
Sep 04, 2013
by
Luis Penaranda
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added orthographic projection
1 parent
44ec9b4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
openglcanvas.cpp
panowindow1.ui
shaders/vertex_shader.vert
openglcanvas.cpp
View file @
dade31c
...
...
@@ -522,6 +522,15 @@ void OpenGLCanvas::vertex_transformation(float *positions, int m, int n, float c
positions
[
3
*
(
j
+
i
*
n
)
+
1
]
=
v
/
extent
;
positions
[
3
*
(
j
+
i
*
n
)
+
2
]
=
z
;
}
if
(
visualization
==
"Orthographic"
){
u
=
x
;
v
=
y
;
positions
[
3
*
(
j
+
i
*
n
)]
=
u
/
extent
;
positions
[
3
*
(
j
+
i
*
n
)
+
1
]
=
v
/
extent
;
positions
[
3
*
(
j
+
i
*
n
)
+
2
]
=
z
;
}
}
}
...
...
@@ -598,6 +607,14 @@ float OpenGLCanvas::calculate_extent(float fov_rads){
u
=
x
/
(
-
z
);
v
=
y
/
(
-
z
);
}
if
(
visualization
==
"Orthographic"
){
if
(
z
<
0.
){
u
=
x
;
v
=
y
;
}
else
{
u
=
v
=
1.
f
;
}
}
return
u
;
}
...
...
@@ -789,6 +806,7 @@ void OpenGLCanvas::paintGL(){
else
if
(
visualization
==
"Stereographic"
)
vis_mode
=
4.0
;
else
if
(
visualization
==
"Mercator"
)
vis_mode
=
5.0
;
else
if
(
visualization
==
"Zorin-Barr"
)
vis_mode
=
6.0
;
else
if
(
visualization
==
"Orthographic"
)
vis_mode
=
7.0
;
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
glOrtho
(
0.0
,
2.0
/
extent
,
0.0
,
2.0
/
scale
,
0.0
,
-
2.0
/
vis_mode
);
...
...
panowindow1.ui
View file @
dade31c
...
...
@@ -207,6 +207,11 @@
<string>
Zorin-Barr
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Orthographic
</string>
</property>
</item>
</widget>
</item>
<item
row=
"12"
column=
"1"
>
...
...
shaders/vertex_shader.vert
View file @
dade31c
...
...
@@ -92,6 +92,11 @@ void main(void){
v
=
zbrho
*
sin
(
zbalpha
);
gl_Position
=
vec4
(
u
/
extent
,
v
/
extent
,
z
,
1
.
0
);
}
else
if
(
vis_mode
==
7
.
0
){
// Orthographic
u
=
x
;
v
=
y
;
gl_Position
=
vec4
(
u
/
extent
,
v
/
extent
,
z
,
1
.
0
);
}
// gl_Position = vec4(u/2.0,v/2.0,z,1.0);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment