diff options
Diffstat (limited to 'util/gencube/genobjcube.cpp')
-rw-r--r-- | util/gencube/genobjcube.cpp | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/util/gencube/genobjcube.cpp b/util/gencube/genobjcube.cpp deleted file mode 100644 index dc78837a..00000000 --- a/util/gencube/genobjcube.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation ([email protected]) -** -** This file is part of the QtQuick3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Used to generate cube.obj. - -#include <stdio.h> - -static float const normals[6 * 3] = { - -1.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, - 1.0f, 0.0f, 0.0f, - 0.0f, -1.0f, 0.0f, - 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, -1.0f -}; - -static float const vertices[8 * 3] = { - -0.5f, -0.5f, -0.5f, - -0.5f, -0.5f, 0.5f, - -0.5f, 0.5f, 0.5f, - -0.5f, 0.5f, -0.5f, - 0.5f, -0.5f, -0.5f, - 0.5f, -0.5f, 0.5f, - 0.5f, 0.5f, 0.5f, - 0.5f, 0.5f, -0.5f -}; - -static float const texCoords[4 * 2] = { - 1.0f, 0.0f, - 1.0f, 1.0f, - 0.0f, 1.0f, - 0.0f, 0.0f -}; - -static unsigned short const indices[6 * 4] = { - 0, 1, 2, 3, 3, 2, 6, 7, 7, 6, 5, 4, - 4, 5, 1, 0, 5, 6, 2, 1, 7, 4, 0, 3 -}; - -int main(int argc, char *argv[]) -{ - printf("s 0\n"); - for (int vert = 0; vert < 8; ++vert) { - printf("v %.1f %.1f %.1f\n", - vertices[vert * 3 + 0], - vertices[vert * 3 + 1], - vertices[vert * 3 + 2]); - } - for (int norm = 0; norm < 6; ++norm) { - printf("vn %.1f %.1f %.1f\n", - normals[norm * 3 + 0], - normals[norm * 3 + 1], - normals[norm * 3 + 2]); - } - for (int tex = 0; tex < 4; ++tex) { - printf("vt %.1f %.1f\n", - texCoords[tex * 2 + 0], - texCoords[tex * 2 + 1]); - } - for (int face = 0; face < 6; ++face) { - printf("f %d/%d/%d %d/%d/%d %d/%d/%d %d/%d/%d\n", - indices[face * 4 + 0] + 1, 1, face + 1, - indices[face * 4 + 1] + 1, 2, face + 1, - indices[face * 4 + 2] + 1, 3, face + 1, - indices[face * 4 + 3] + 1, 4, face + 1); - } - return 0; -} |