Obviously, the vertices are being read correctly. However, here's what I get when I add the normas:
What gives? I suspect this is a problem with my shader(s). Hopefully this "globe" shape will be a tell-tale sign of something I've done wrong.
Here are the shaders I'm using:
//vertex shader
attribute vec3 v_position;
attribute vec3 v_normal;
varying float lightIntensity;
uniform mat4 model;
//uniform mat4 view;
uniform mat4 proj;
void main(void)
{
vec4 newPosition = proj * model * vec4(v_position,1.0);
gl_Position = newPosition;
//specify direction of light
vec3 light_dir = vec3(0.9,0.8,-3.0);
//if I use this, it looks like a messed up sphere
vec4 newNormal = proj * model * vec4(v_normal,0.0);
//if I use this, I can make out the shape of the model,
//but the lighting over the model is wrong.
//vec4 newNormal = proj * model * vec4(v_position,0.0);
lightIntensity = max(0.0, dot(newNormal.xyz, light_dir));
}
//fragment shader
varying float lightIntensity;
void main(void)
{
vec4 yellow = vec4(1.0, 1.0, 0.0, 1.0);
gl_FragColor = vec4((yellow * lightIntensity * 0.2).rgb, 1.0);
}

Find content
Not Telling