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
d8c970c0
Commit
d8c970c0
authored
Aug 14, 2013
by
Luis Penaranda
Browse files
towards passing automatically ZB parameters
parent
f1178162
Changes
2
Hide whitespace changes
Inline
Side-by-side
openglcanvas.cpp
View file @
d8c970c0
...
...
@@ -709,6 +709,12 @@ void OpenGLCanvas::setShaders() {
GLuint
p
=
glCreateProgram
();
// Bind attributes zblambda and zbR to the vertex shader
glVertexAttrib1f
(
0
,
zblambda
);
glBindAttribLocation
(
p
,
0
,
"zblambda"
);
glVertexAttrib1f
(
1
,
zbR
);
glBindAttribLocation
(
p
,
1
,
"zbR"
);
glAttachShader
(
p
,
v
);
glAttachShader
(
p
,
f
);
...
...
shaders/test_vertex_shader.vert
View file @
d8c970c0
...
...
@@ -6,7 +6,9 @@ float u, v, x, y, z;
varying
float
r
,
theta
,
s
;
float
lambda
,
phi
;
float
extent
,
scale
,
vis_mode
,
center_lambda
,
center_phi
;
varying
float
zblambda
,
zbr
,
zbR
,
zbalpha
,
zbrho
;
float
zbr
,
zbalpha
,
zbrho
;
/*attribute*/
float
zblambda
;
/*attribute*/
float
zbR
;
void
main
(
void
){
...
...
@@ -85,7 +87,6 @@ void main(void){
u
=
x
/
(
-
z
);
v
=
y
/
(
-
z
);
// Z-B transformation
// TODO: read zblambda and zbR from the interface
zblambda
=
0
.
1
;
zbR
=
1
.
0
;
zbalpha
=
atan
(
v
,
u
);
...
...
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