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
f5e82d53
Kaydet (Commit)
f5e82d53
authored
Ock 15, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
Ock 29, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
finally fix rectangle rendering
Change-Id: Iaf0467ce4d9eb12ac3e84c2f1059b859ee9c4de1
üst
6a515ca1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
24 deletions
+25
-24
OpenGLRender.cxx
chart2/source/view/main/OpenGLRender.cxx
+22
-17
OpenGLRender.hxx
chart2/source/view/main/OpenGLRender.hxx
+3
-7
No files found.
chart2/source/view/main/OpenGLRender.cxx
Dosyayı görüntüle @
f5e82d53
...
...
@@ -211,13 +211,6 @@ static GLfloat coordVertices[] = {
0.0
f
,
1.0
f
,
};
static
GLfloat
square2DVertices
[]
=
{
-
1.0
f
,
-
1.0
f
,
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
-
1.0
f
,
1.0
f
};
#if 0
static const GLfloat g_vertex_buffer_data[] = {
-1.0f,-1.0f,-1.0f,
...
...
@@ -1346,34 +1339,46 @@ int OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float
//check whether to create the circle data
float
actualX
=
x
/
OPENGL_SCALE_VALUE
;
float
actualY
=
y
/
OPENGL_SCALE_VALUE
;
RectanglePointList
aRectangleList
.
x
=
actualX
;
aRectangleList
.
y
=
actualY
;
aRectangleList
.
z
=
m_fZStep
;
aRectangleList
.
xScale
=
directionX
/
OPENGL_SCALE_VALUE
;
aRectangleList
.
yScale
=
directionY
/
OPENGL_SCALE_VALUE
;
m_RectangleShapePointList
.
push_back
(
aRectangleList
);
float
actualSizeX
=
directionX
/
OPENGL_SCALE_VALUE
;
float
actualSizeY
=
directionY
/
OPENGL_SCALE_VALUE
;
RectanglePointList
aRectangle
;
aRectangle
.
points
[
0
]
=
actualX
;
aRectangle
.
points
[
1
]
=
actualY
;
aRectangle
.
points
[
2
]
=
m_fZStep
;
aRectangle
.
points
[
3
]
=
actualX
+
actualSizeX
;
aRectangle
.
points
[
4
]
=
actualX
;
aRectangle
.
points
[
5
]
=
m_fZStep
;
aRectangle
.
points
[
6
]
=
actualX
+
actualSizeX
;
aRectangle
.
points
[
7
]
=
actualX
+
actualSizeY
;
aRectangle
.
points
[
8
]
=
m_fZStep
;
aRectangle
.
points
[
9
]
=
actualX
;
aRectangle
.
points
[
10
]
=
actualX
+
actualSizeY
;
aRectangle
.
points
[
11
]
=
m_fZStep
;
m_RectangleShapePointList
.
push_back
(
aRectangle
);
return
0
;
}
int
OpenGLRender
::
RenderRectangleShape
()
{
m_fZStep
+=
0.001
;
size_t
listNum
=
m_RectangleShapePointList
.
size
();
for
(
size_t
i
=
0
;
i
<
listNum
;
i
++
)
{
//move the circle to the pos, and scale using the xScale and Y scale
RectanglePointList
&
pointList
=
m_RectangleShapePointList
.
front
();
PosVecf3
trans
=
{
pointList
.
x
,
pointList
.
y
,
pointList
.
z
};
PosVecf3
trans
=
{
0
,
0
,
0
};
PosVecf3
angle
=
{
0.0
f
,
0.0
f
,
0.0
f
};
PosVecf3
scale
=
{
pointList
.
xScale
,
pointList
.
yScale
,
1.0
f
};
PosVecf3
scale
=
{
1
,
1
,
1.0
f
};
MoveModelf
(
trans
,
angle
,
scale
);
m_MVP
=
m_Projection
*
m_View
*
m_Model
;
//render to fbo
//fill vertex buffer
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_VertexBuffer
);
glBufferData
(
GL_ARRAY_BUFFER
,
sizeof
(
square2DVertices
),
square2DVertice
s
,
GL_STATIC_DRAW
);
glBufferData
(
GL_ARRAY_BUFFER
,
sizeof
(
pointList
.
points
),
pointList
.
point
s
,
GL_STATIC_DRAW
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_ColorBuffer
);
glBufferData
(
GL_ARRAY_BUFFER
,
sizeof
(
m_BackgroundColor
),
m_BackgroundColor
,
GL_STATIC_DRAW
);
...
...
chart2/source/view/main/OpenGLRender.hxx
Dosyayı görüntüle @
f5e82d53
...
...
@@ -84,14 +84,10 @@ typedef struct Bubble2DCircle
int
bufLen
;
}
Bubble2DCircle
;
typedef
struct
RectanglePointList
struct
RectanglePointList
{
float
x
;
float
y
;
float
z
;
float
xScale
;
float
yScale
;
}
RectanglePointList
;
float
points
[
12
];
};
typedef
struct
TextInfo
{
...
...
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