Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
ee829247
Commit
ee829247
authored
Mar 04, 1994
by
Ken Martin
Browse files
Some fixes to World to Display
parent
42994b51
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Renderer.cc
View file @
ee829247
...
...
@@ -82,9 +82,14 @@ void vlRenderer::DoLights()
void
vlRenderer
::
DoCameras
()
{
vlCamera
*
cam1
;
if
(
!
this
->
UpdateCameras
())
{
cerr
<<
"No cameras are on, creating one.
\n
"
;
cerr
<<
this
->
GetClassName
()
<<
" : No cameras are on, creating one.
\n
"
;
cam1
=
this
->
RenderWindow
->
MakeCamera
();
this
->
SetActiveCamera
(
cam1
);
this
->
UpdateCameras
();
}
}
...
...
@@ -124,7 +129,7 @@ void vlRenderer::DisplayToView()
void
vlRenderer
::
ViewToDisplay
()
{
floa
t
dx
,
dy
;
in
t
dx
,
dy
;
int
sizex
,
sizey
;
int
*
size
;
...
...
@@ -133,12 +138,12 @@ void vlRenderer::ViewToDisplay()
sizex
=
size
[
0
];
sizey
=
size
[
1
];
dx
=
(
this
->
ViewPoint
[
0
]
/
this
->
Aspect
[
0
]
+
1.0
)
*
dx
=
(
int
)(
(
this
->
ViewPoint
[
0
]
/
this
->
Aspect
[
0
]
+
1.0
)
*
(
sizex
*
(
this
->
Viewport
[
2
]
-
this
->
Viewport
[
0
]))
/
2.0
+
0.5
+
sizex
*
this
->
Viewport
[
0
];
dy
=
(
this
->
ViewPoint
[
1
]
/
this
->
Aspect
[
1
]
+
1.0
)
*
sizex
*
this
->
Viewport
[
0
]
)
;
dy
=
(
int
)(
(
this
->
ViewPoint
[
1
]
/
this
->
Aspect
[
1
]
+
1.0
)
*
(
sizey
*
(
this
->
Viewport
[
3
]
-
this
->
Viewport
[
1
]))
/
2.0
+
0.5
+
sizey
*
this
->
Viewport
[
1
];
sizey
*
this
->
Viewport
[
1
]
)
;
this
->
SetDisplayPoint
(
dx
,
dy
,
this
->
ViewPoint
[
2
]);
}
...
...
@@ -150,7 +155,7 @@ void vlRenderer::ViewToWorld()
float
result
[
4
];
// get the perspective transformation from the active camera
//
mat = this->ActiveCamera->GetPerspectiveTransform();
mat
=
this
->
ActiveCamera
->
GetPerspectiveTransform
();
// use the inverse matrix
mat
.
Invert
();
...
...
Write
Preview
Supports
Markdown
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