Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
dbd5a700
Commit
dbd5a700
authored
14 years ago
by
Gilles Marckmann
Browse files
Options
Downloads
Patches
Plain Diff
implementation of stereography
parent
c76a4d8a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Fltk/graphicWindow.cpp
+4
-0
4 additions, 0 deletions
Fltk/graphicWindow.cpp
Fltk/openglWindow.cpp
+7
-6
7 additions, 6 deletions
Fltk/openglWindow.cpp
Graphics/Camera.cpp
+2
-1
2 additions, 1 deletion
Graphics/Camera.cpp
Graphics/drawContext.cpp
+5
-5
5 additions, 5 deletions
Graphics/drawContext.cpp
with
18 additions
and
12 deletions
Fltk/graphicWindow.cpp
+
4
−
0
View file @
dbd5a700
...
@@ -584,6 +584,10 @@ graphicWindow::graphicWindow(bool main, int numTiles)
...
@@ -584,6 +584,10 @@ graphicWindow::graphicWindow(bool main, int numTiles)
int
mode
=
FL_RGB
|
FL_DEPTH
|
(
CTX
::
instance
()
->
db
?
FL_DOUBLE
:
FL_SINGLE
);
int
mode
=
FL_RGB
|
FL_DEPTH
|
(
CTX
::
instance
()
->
db
?
FL_DOUBLE
:
FL_SINGLE
);
if
(
CTX
::
instance
()
->
antialiasing
)
mode
|=
FL_MULTISAMPLE
;
if
(
CTX
::
instance
()
->
antialiasing
)
mode
|=
FL_MULTISAMPLE
;
//mode |= FL_STEREO;
//mode |= FL_STEREO;
if
(
CTX
::
instance
()
->
stereo
)
{
mode
|=
FL_DOUBLE
;
mode
|=
FL_STEREO
;
}
for
(
unsigned
int
i
=
0
;
i
<
gl
.
size
();
i
++
)
gl
[
i
]
->
mode
(
mode
);
for
(
unsigned
int
i
=
0
;
i
<
gl
.
size
();
i
++
)
gl
[
i
]
->
mode
(
mode
);
tile
->
end
();
tile
->
end
();
...
...
This diff is collapsed.
Click to expand it.
Fltk/openglWindow.cpp
+
7
−
6
View file @
dbd5a700
...
@@ -271,7 +271,6 @@ void openglWindow::draw()
...
@@ -271,7 +271,6 @@ void openglWindow::draw()
glAccum(GL_RETURN,1.0);
glAccum(GL_RETURN,1.0);
*/
*/
glClear
(
GL_DEPTH_BUFFER_BIT
|
GL_COLOR_BUFFER_BIT
);
//right eye
//right eye
XYZ
eye
=
cam
->
eyesep
/
2.0
*
cam
->
right
;
XYZ
eye
=
cam
->
eyesep
/
2.0
*
cam
->
right
;
...
@@ -291,6 +290,8 @@ void openglWindow::draw()
...
@@ -291,6 +290,8 @@ void openglWindow::draw()
cam
->
up
.
x
,
cam
->
up
.
y
,
cam
->
up
.
z
);
cam
->
up
.
x
,
cam
->
up
.
y
,
cam
->
up
.
z
);
_ctx
->
draw3d
();
_ctx
->
draw3d
();
_ctx
->
draw2d
();
_ctx
->
draw2d
();
_drawScreenMessage
();
_drawBorder
();
//left eye
//left eye
glMatrixMode
(
GL_PROJECTION
);
glMatrixMode
(
GL_PROJECTION
);
...
@@ -310,8 +311,8 @@ void openglWindow::draw()
...
@@ -310,8 +311,8 @@ void openglWindow::draw()
cam
->
up
.
x
,
cam
->
up
.
y
,
cam
->
up
.
z
);
cam
->
up
.
x
,
cam
->
up
.
y
,
cam
->
up
.
z
);
_ctx
->
draw3d
();
_ctx
->
draw3d
();
_ctx
->
draw2d
();
_ctx
->
draw2d
();
_drawScreenMessage
();
glPushMatrix
();
_drawBorder
();
}
}
else
{
else
{
...
...
This diff is collapsed.
Click to expand it.
Graphics/Camera.cpp
+
2
−
1
View file @
dbd5a700
...
@@ -25,7 +25,8 @@ void Camera::init(){
...
@@ -25,7 +25,8 @@ void Camera::init(){
on
=
true
;
on
=
true
;
glFnear
=
0.1
;
glFnear
=
0.1
;
glFfar
=
10000
;
glFfar
=
10000
;
eye_sep_ratio
=
.015
;
// eye_sep_ratio=.015;
eye_sep_ratio
=
.05
;
// apparent angle of the screen height
// apparent angle of the screen height
aperture
=
25
;
aperture
=
25
;
focallength
=
100.
;
focallength
=
100.
;
...
...
This diff is collapsed.
Click to expand it.
Graphics/drawContext.cpp
+
5
−
5
View file @
dbd5a700
...
@@ -455,7 +455,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick)
...
@@ -455,7 +455,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick)
fabs
(
CTX
::
instance
()
->
max
[
2
]));
fabs
(
CTX
::
instance
()
->
max
[
2
]));
if
(
zmax
<
CTX
::
instance
()
->
lc
)
zmax
=
CTX
::
instance
()
->
lc
;
if
(
zmax
<
CTX
::
instance
()
->
lc
)
zmax
=
CTX
::
instance
()
->
lc
;
if
(
CTX
::
instance
()
->
camera
)
{
// if we use the new camera mode
if
(
(
CTX
::
instance
()
->
camera
)
&&
(
!
CTX
::
instance
()
->
stereo
)
)
{
// if we use the new camera mode
double
clip_near
,
clip_far
;
double
clip_near
,
clip_far
;
clip_near
=
0.75
*
CTX
::
instance
()
->
clipFactor
*
zmax
;
clip_near
=
0.75
*
CTX
::
instance
()
->
clipFactor
*
zmax
;
...
@@ -472,12 +472,12 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick)
...
@@ -472,12 +472,12 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick)
glBegin
(
GL_QUADS
);
glBegin
(
GL_QUADS
);
//glColor4ubv((GLubyte *) & CTX::instance()->color.bg);
//glColor4ubv((GLubyte *) & CTX::instance()->color.bg);
glColor3d
(
.8
,
.8
,
.95
);
glColor3d
(
.8
,
.8
,
.95
);
glVertex3i
(
-
dx
,
-
dy
,
dz
);
glVertex3i
(
(
int
)
-
dx
,(
int
)
-
dy
,(
int
)
dz
);
glVertex3i
(
dx
,
-
dy
,
dz
);
glVertex3i
(
(
int
)
dx
,(
int
)
-
dy
,(
int
)
dz
);
// glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad);
// glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad);
glColor3d
(
.1
,
.1
,
.3
);
glColor3d
(
.1
,
.1
,
.3
);
glVertex3i
(
dx
,
dy
,
dz
);
glVertex3i
(
(
int
)
dx
,(
int
)
dy
,(
int
)
dz
);
glVertex3i
(
-
dx
,
dy
,
dz
);
glVertex3i
(
(
int
)
-
dx
,(
int
)
dy
,(
int
)
dz
);
glEnd
();
glEnd
();
glPopMatrix
();
glPopMatrix
();
glEnable
(
GL_DEPTH_TEST
);
glEnable
(
GL_DEPTH_TEST
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment