Hi Alan,
It looks like you haven't received many replies yet. I ran into the
same problem, but I managed to find a solution. Albeit not the most
elegant, it did allow me to carry on working.
OK, your problem is around here
> The actual lines of code are:
> float [] perspectiveMatrix = createPerspectiveMatrix(45, 1,
> 0.1f, 1000);
> WebGLUniformLocation uniformLocation =
> glContext.getUniformLocation(shaderProgram, "perspectiveMatrix");
> checkError();
>
> glContext.uniformMatrix4fv(uniformLocation, false,
> perspectiveMatrix);
>
Right?
There seem to be a problem with the binding and how it parses certain
arguments. So, for instance, in the case of the "FlatShader" or the
"BasicShader3D", the issue with the matrices was solved here:
http://code.google.com/p/gwt-g3d/issues/detail?id=2&can=1&q=TBasicShader3D%20setModelViewMatrix%20causes%20JavaScript%20error
Basically, it needed to replace the following code:
public void setProjectionMatrix(Matrix4f value) {
gl.uniformMatrix(getUniformLocation("uProjectionMatrix"),
value);
}
with:
public void setProjectionMatrix(Matrix4f value) {
// gl.uniformMatrix(getUniformLocation("uProjectionMatrix"),
value);
float[] matrixValue = MatrixUtils.toFloatArray(value);
WebGLUniformLocation mvMatrixLoc =
getUniformLocation("uProjectionMatrix");
gl.uniformMatrix4fv(mvMatrixLoc, false,
WebGLFloatArray.createArray(matrixValue));
}
And similarly with the ModelView. As you can see, in your case the
perspectiveMatrix needs to be passed in as
WebGLFloatArray.createArray(perspectiveMatrix).
Hope this helps you, and let's hope the guys manage to get this fix
into their next release. I've been trying other WebGL wrappers for
GWT, but it does seem like these guys have gone further than anybody.
Funny thing though is that their examples do not work with Google's
chromium, but with Mozilla's minefield. Go figure.
Regards.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.