Hi,
I have a little problem: I don’t know how to transform single vertices!
I made this testfunction to get a good understanding of the transformation matrix and all the parameters:
int testfunc1 (GLfloat x, GLfloat y, GLfloat z)
{
GLfloat vRed= {1.0f, 0.0f, 0.0f, 1.0f};
glPointSize(3.0f);
M3DMatrix44f TestMatrix =
{1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.1f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.5f, 0.0f, 0.0f, 1.0f} ;
shaderManager.UseStockShader(GLT_SHADER_FLAT, TestMatrix, vRed);
glBegin(GL_POINTS);
glVertex3f(x,y,z);
glEnd();
return 0;
}
I added it to my RenderScene:
void RenderScene(void)
{
// Clear the window and the depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
[b]//this point is translated too! But why? :([/b]
glBegin(GL_POINTS);
glVertex3f(0.0f, 0.0f, 0.0f);
glEnd();
testfunc1(0.2f, 0.0f,0.0f);
// Swap buffers, and immediately refresh glutSwapBuffers();
}
The Problem is, that my testfunc1 also transforms all other points that are specified in my RenderScene function.
I hope you can hel me