The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Showing axis in WebGL

Hi,

I want to show the input box and allow users to input the rotation value and translation value to update the model. However, I think users does not know where is X, Y, Z axis. Is it possible to show the X, Y, Z axis in WebGL and how to show them correctly? Is there any existing functions?

Re: Showing axis in WebGL

No, there is no function for that. I usually use my art tools (blender, Maya, etc) to make a 3D model called a "gnomon" (three arrows, one red, one green and one blue that are at right angles to each other with the red one pointing in the X direction, green in Y and blue in Z) - then write code to display that at the origin or at zero height at the center of the screen on a particular key press.

I can use the same thing to pop up a plain white sphere at the same location to check light source directions.

When I draw the line (x, y, z axis) and texture (x, y, z letter), it draws nothing. When I remove the lighting effect and use the shader scripts without lighting effect, it draws the model and axis correctly.

Re: Showing axis in WebGL

You can use my my model. Its a low-poly gnomon with RGB colors baked in vertex normals. You can ignore vertexNormals and texCoords. Also, you will need a shader that displays flat vertex color.http://chrysaora.com/meshes/axis.jsonIt is a triangulated ELEMENT_ARRAY_BUFFER