Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b53e1acd
Kaydet (Commit)
b53e1acd
authored
May 10, 2014
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
keep camera calculations out of the rendering code
Change-Id: I7a26ce1881958a7465692174dd8ea793b593efad
üst
28e7d538
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
47 deletions
+5
-47
GL3DRenderer.hxx
chart2/source/view/inc/GL3DRenderer.hxx
+2
-4
3DChartObjects.cxx
chart2/source/view/main/3DChartObjects.cxx
+1
-1
GL3DRenderer.cxx
chart2/source/view/main/GL3DRenderer.cxx
+2
-42
No files found.
chart2/source/view/inc/GL3DRenderer.hxx
Dosyayı görüntüle @
b53e1acd
...
...
@@ -113,14 +113,12 @@ struct Extrude3DInfo
struct
CameraInfo
{
bool
useDefault
;
glm
::
vec3
cameraPos
;
glm
::
vec3
cameraOrg
;
glm
::
vec3
cameraUp
;
CameraInfo
()
:
useDefault
(
true
),
cameraUp
(
glm
::
vec3
(
0
,
1
,
0
))
{}
cameraUp
(
glm
::
vec3
(
0
,
0
,
1
))
{}
};
struct
CoordinateAxisInfo
...
...
@@ -203,7 +201,7 @@ public:
void
SetClickPos
(
Point
aMPos
);
void
RenderClickPos
(
Point
aMPos
);
void
SetSize
(
const
Size
&
rSize
);
void
SetCameraInfo
(
glm
::
vec3
pos
,
glm
::
vec3
direction
,
glm
::
vec3
up
,
bool
useDefalut
);
void
SetCameraInfo
(
glm
::
vec3
pos
,
glm
::
vec3
direction
,
glm
::
vec3
up
);
void
CreateTextTexture
(
const
BitmapEx
&
rBitmapEx
,
glm
::
vec3
vTopLeft
,
glm
::
vec3
vTopRight
,
glm
::
vec3
vBottomRight
,
glm
::
vec3
vBottomLeft
);
void
ProcessUnrenderedShape
();
private
:
...
...
chart2/source/view/main/3DChartObjects.cxx
Dosyayı görüntüle @
b53e1acd
...
...
@@ -184,7 +184,7 @@ Camera::Camera(OpenGL3DRenderer* pRenderer):
void
Camera
::
render
()
{
mpRenderer
->
SetCameraInfo
(
maPos
,
maDirection
,
maUp
,
false
);
mpRenderer
->
SetCameraInfo
(
maPos
,
maDirection
,
maUp
);
}
void
Camera
::
zoom
(
sal_uInt32
/*nId*/
)
...
...
chart2/source/view/main/GL3DRenderer.cxx
Dosyayı görüntüle @
b53e1acd
...
...
@@ -20,7 +20,6 @@
#include <StaticGeometry.h>
#include "glm/gtc/matrix_inverse.hpp"
#define GL_PI 3.14159f
#define RGB_WHITE (0xFF | (0xFF << 8) | (0xFF << 16))
#define DEBUG_FBO 0
...
...
@@ -141,13 +140,8 @@ void OpenGL3DRenderer::LoadShaders()
CHECK_GL_ERROR
();
}
void
OpenGL3DRenderer
::
SetCameraInfo
(
glm
::
vec3
pos
,
glm
::
vec3
direction
,
glm
::
vec3
up
,
bool
useDefalut
)
void
OpenGL3DRenderer
::
SetCameraInfo
(
glm
::
vec3
pos
,
glm
::
vec3
direction
,
glm
::
vec3
up
)
{
m_CameraInfo
.
useDefault
=
useDefalut
;
if
(
m_CameraInfo
.
useDefault
)
{
return
;
}
m_CameraInfo
.
cameraPos
=
pos
;
m_CameraInfo
.
cameraOrg
=
pos
+
direction
;
m_CameraInfo
.
cameraUp
=
up
;
...
...
@@ -1458,26 +1452,6 @@ void OpenGL3DRenderer::RenderClickPos(Point aMPos)
void
OpenGL3DRenderer
::
CreateSceneBoxView
()
{
if
(
m_CameraInfo
.
useDefault
)
{
float
senceBoxWidth
=
m_SenceBox
.
maxXCoord
-
m_SenceBox
.
minXCoord
;
float
senceBoxHeight
=
m_SenceBox
.
maxYCoord
-
m_SenceBox
.
minYCoord
;
float
senceBoxDepth
=
m_SenceBox
.
maxZCoord
-
m_SenceBox
.
minZCoord
;
float
distanceZ
=
m_SenceBox
.
maxZCoord
+
senceBoxWidth
/
2
/
tan
(
m_fViewAngle
/
2
*
GL_PI
/
180.0
f
);
float
veriticalAngle
=
atan
((
float
)
m_iHeight
/
(
float
)
m_iWidth
);
float
distance
=
distanceZ
/
cos
(
veriticalAngle
);
float
horizontalAngle
=
0
;
m_fHeightWeight
=
senceBoxWidth
*
(
float
)
m_iHeight
/
(
float
)
m_iWidth
/
senceBoxHeight
;
m_SenceBox
.
maxYCoord
*=
m_fHeightWeight
;
m_SenceBox
.
minYCoord
*=
m_fHeightWeight
;
m_CameraInfo
.
cameraOrg
=
glm
::
vec3
(
m_SenceBox
.
minXCoord
+
senceBoxWidth
/
2
,
m_SenceBox
.
minYCoord
+
senceBoxHeight
*
m_fHeightWeight
/
2
,
m_SenceBox
.
minZCoord
+
senceBoxDepth
*
2
);
//update the camera position and org
m_CameraInfo
.
cameraPos
.
x
=
m_CameraInfo
.
cameraOrg
.
x
+
distance
*
cos
(
veriticalAngle
)
*
sin
(
horizontalAngle
);
m_CameraInfo
.
cameraPos
.
z
=
m_CameraInfo
.
cameraOrg
.
z
+
distance
*
cos
(
veriticalAngle
)
*
cos
(
horizontalAngle
);
m_CameraInfo
.
cameraPos
.
y
=
m_CameraInfo
.
cameraOrg
.
y
+
distance
*
sin
(
veriticalAngle
);
}
m_3DView
=
glm
::
lookAt
(
m_CameraInfo
.
cameraPos
,
// Camera is at (0,0,3), in World Space
m_CameraInfo
.
cameraOrg
,
// and looks at the origin
m_CameraInfo
.
cameraUp
// Head is up (set to 0,-1,0 to look upside-down)
...
...
@@ -1601,25 +1575,11 @@ int OpenGL3DRenderer::ProcessExtrude3DPickingBox()
}
return
0
;
}
//reset the camera by index
//update the camera position and org
float
distance
=
500
;
float
veriticalAngle
=
GL_PI
/
3.25
f
;
float
horizontalAngle
=
GL_PI
/
6.0
f
;
extrude3DInfo
=
m_Extrude3DList
[
selectID
];
extrude3DInfo
.
yTransform
*=
m_fHeightWeight
;
extrude3DInfo
.
yScale
*=
m_fHeightWeight
;
int
reverse
=
1
;
if
(
m_CameraInfo
.
useDefault
)
{
m_CameraInfo
.
cameraOrg
=
glm
::
vec3
(
extrude3DInfo
.
xTransform
+
extrude3DInfo
.
xScale
/
2
,
-
extrude3DInfo
.
yTransform
+
extrude3DInfo
.
yScale
*
reverse
,
extrude3DInfo
.
zTransform
+
extrude3DInfo
.
xScale
/
2
);
m_CameraInfo
.
cameraPos
.
x
=
m_CameraInfo
.
cameraOrg
.
x
-
distance
*
cos
(
veriticalAngle
)
*
sin
(
horizontalAngle
);
m_CameraInfo
.
cameraPos
.
z
=
m_CameraInfo
.
cameraOrg
.
z
+
distance
*
cos
(
veriticalAngle
)
*
cos
(
horizontalAngle
);
m_CameraInfo
.
cameraPos
.
y
=
m_CameraInfo
.
cameraOrg
.
y
+
distance
*
sin
(
horizontalAngle
)
*
reverse
;
}
m_3DView
=
glm
::
lookAt
(
m_CameraInfo
.
cameraPos
,
// Camera is at (0,0,3), in World Space
m_CameraInfo
.
cameraOrg
,
// and looks at the origin
m_CameraInfo
.
cameraUp
// Head is up (set to 0,-1,0 to look upside-down)
...
...
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