# Blender v2.65 (sub 0) OBJ File
# www.blender.org
o teapot.005
v -0.498530 0.712498 -0.039883
v -0.501666 0.699221 -0.063813
v -0.501255 0.717792 0.000000
v -0.624036 0.711938 -0.039883
v -0.526706 0.651362 -0.039883
v -0.508714 0.682112 -0.071712
v -0.622039 0.698704 -0.063813
v -0.624834 0.717232 0.000000
v -0.498530 0.712498 0.039883
v -0.638129 0.287158 0.000000
v -0.517593 0.664661 -0.063813
v -0.534329 0.646030 0.000000
v -0.614850 0.651067 -0.039883
# etc. and so on<= into =>
http://www.sjbaker.org/wiki/index.php?title=The_History_of_The_Teapot
Possible vertex data includes:
//parse from disk and translate to this:
struct Vertex
{
float32[4] position;
float32[2] diffuseTexCoord;
//and/or other TexCoords
int32[4] boneIndices;
float32[4] boneWeights;
}
//...
auto vertices = std::vector<Vertex>(NUM_VERTICES);
I
Additional reading:
http://www.codinglabs.net/article_world_view_projection_matrix.aspx
#version 410
#Example OpenGL vertex shader
layout (std140) uniform Matrices { #transformation matrices,
mat4 projModelViewMatrix; #output from earlier scene graph
mat3 normalMatrix;
};
in vec3 position; #mirrors whatever vertex format you had
in vec3 normal;
in vec2 texCoord;
out VertexData { #"Varying" interpolated attributes in vertex-to-fragment stage
vec2 texCoord;
vec3 normal;
} VertexOut;
void main()
{
VertexOut.texCoord = texCoord;
VertexOut.normal = normalize(normalMatrix * normal);
gl_Position = projModelViewMatrix * vec4(position, 1.0);
}#version 410
#Simple diffuse texture mapping fragment shader
varying vec2 diffuseTexCoord;
uniform sampler2D diffuseTexture;
void main()
{
gl_FragColor = texture2D(diffuseTexture, diffuseTexCoord.st);
}