hello.
I have this test webgl vertex shader:
<script id="TextureEffectv" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec3 aVertexNormal;
attribute vec2 aTextureCoord;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform mat3 uNMatrix;
uniform vec3 uAmbientColor;
uniform vec3 uLightingDirection;
uniform vec3 uLightingDirection2;
uniform vec3 CameraModelPosition;
uniform vec3 ColorFront;
uniform vec3 ColorBack;
varying vec3 transformedNormal;
varying vec3 vLightWeighting;
varying vec3 vLightWeightingback;
varying vec2 vTextureCoord;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
vTextureCoord = aTextureCoord;
vec3 uDirectionalColor = vec3(1,1,1);
transformedNormal = uNMatrix * aVertexNormal;
float directionalLightWeighting = max(dot(transformedNormal, uLightingDirection), 0.0) ;
vLightWeighting = uDirectionalColor * directionalLightWeighting * ColorFront ;
float directionalLightWeighting2 = max(dot(transformedNormal, uLightingDirection2), 0.0) ;
vLightWeighting += uDirectionalColor * directionalLightWeighting2 * ColorFront ;
float directionalLightWeightingback = max(dot(transformedNormal, uLightingDirection), 0.0) ;
vLightWeightingback = uDirectionalColor * directionalLightWeightingback * ColorBack ;
float directionalLightWeighting2back = max(dot(transformedNormal, uLightingDirection2), 0.0) ;
vLightWeightingback += uDirectionalColor * directionalLightWeighting2back * ColorBack ;
}
</script>
Now i would draw a mesh at 0,0,-1000 without the gllookat or glorto.
I have only the uMVMatrix for do this, is sufficent?
how i can change the word view matrix for draw the mesh at 0,0,-1000?
I know that the camera position is the inverse of the word view matrix?
but… i 'm not understand at all
thanks.