i render an object and need inside the
vertexshader the X and Z Position
including transformation and rotation.
For example an chessboard… if you move an box
over the board ,the top of the box got the same texture(coords)
like the chessboard direct under the box (the sides dosn’t matter)
gl_Vertex.xz … perfect…but only tranformation and Rotation is missing
You didn’t describe what you mean by “strange results,” so you make anyone trying to answer your question have to guess what your problem is.
You used the phrase “including transformation and rotation” in your fourth paragraph (and essentially again in the sixth paragraph). What do you mean by transformation? Do you really mean translation? Rotation is a transformation. So is perspective projection.
I’m guessing what you don’t like is the projection transform which you have applied to your computation of gl_Position. If you want a version of your X and Z coordinates but without the perspective transformation applied to them, then separate your modelview and projection transforms, and save the X and Z coordinates between your application of them.