git-svn-id: svn://db.shs.com.ru/libs@66 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-09 19:52:38 +00:00
parent 458a516317
commit 0dcea8e214

View File

@@ -59,7 +59,6 @@ void GLPrimitiveCube::init() {
d_vertices.clear();
d_normals.clear();
d_uvs.clear();
for (int i = 0; i < 4; ++i)
d_normals << 0. << -1. << 0.;
d_vertices << -hw << -hl << -hh;
@@ -67,7 +66,6 @@ void GLPrimitiveCube::init() {
d_vertices << hw << -hl << hh;
d_vertices << -hw << -hl << hh;
d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.;
for (int i = 0; i < 4; ++i)
d_normals << 0. << 1. << 0.;
d_vertices << -hw << hl << -hh;
@@ -75,7 +73,6 @@ void GLPrimitiveCube::init() {
d_vertices << hw << hl << hh;
d_vertices << hw << hl << -hh;
d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.;
for (int i = 0; i < 4; ++i)
d_normals << -1. << 0. << 0.;
d_vertices << -hw << -hl << -hh;
@@ -83,7 +80,6 @@ void GLPrimitiveCube::init() {
d_vertices << -hw << hl << hh;
d_vertices << -hw << hl << -hh;
d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.;
for (int i = 0; i < 4; ++i)
d_normals << 1. << 0. << 0.;
d_vertices << hw << -hl << -hh;
@@ -91,7 +87,6 @@ void GLPrimitiveCube::init() {
d_vertices << hw << hl << hh;
d_vertices << hw << -hl << hh;
d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.;
for (int i = 0; i < 4; ++i)
d_normals << 0. << 0. << -1.;
d_vertices << -hw << -hl << -hh;
@@ -99,7 +94,6 @@ void GLPrimitiveCube::init() {
d_vertices << hw << hl << -hh;
d_vertices << hw << -hl << -hh;
d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.;
for (int i = 0; i < 4; ++i)
d_normals << 0. << 0. << 1.;
d_vertices << -hw << -hl << hh;
@@ -107,7 +101,6 @@ void GLPrimitiveCube::init() {
d_vertices << hw << hl << hh;
d_vertices << -hw << hl << hh;
d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.;
is_init = true;
vbo.rebuffer();
}
@@ -142,8 +135,8 @@ void GLPrimitiveEllipsoid::init() {
QVector<QVector3D> points;
vbo.clear();
vbo.init();
int ret = 0, hseg = sh + 1, wlseg = swl + 1;
uint ret = 0;
int hseg = sh + 1, wlseg = swl + 1;
double crw, crl, a, ch, twl;
QVector3D cp(0., 0., -h / 2.);
points << cp;
@@ -179,7 +172,6 @@ void GLPrimitiveEllipsoid::init() {
putTriangle(points[ret - 1], points[ret - wlseg * 2], points[ret]);
for (int j = 1; j < wlseg * 2; j++)
if (j > 0) putTriangle(points[ret - wlseg * 2 + j - 1], points[ret - wlseg * 2 + j], points[ret]);
is_init = true;
vbo.rebuffer();
}