View Full Version : Showing axis in WebGL

02-23-2011, 03:51 AM

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?

Alfonse Reinheart
02-23-2011, 09:01 AM
There is no "glShowAxis" function. And how could there be? OpenGL doesn't have a concept of "model". And WebGL, which is shader-based, has no concept of "space" or "axes" or anything of the like.

If you want to draw axes, then you must draw axes. And if you want these axes to align with a particular model's orientation, then you must do the math to align them with that model's orientation (which usually consists of using that model's orientation when rendering the axes).

02-24-2011, 05:27 AM
Oh, do you mean I need to create some buffers to store the axis vertex, color and draw them using line, create some textures to show the x, y, z axis labels?