views:

32

answers:

1

Can I set the current render position to be an arbitrary value, instead of just giving it an offset from the current location?

This is what I'm doing currently:

gl.glTranslatef(3.0f, 0.0f, 2.0f);

It allows me to say "I want to move left" but not "I want to move to point (2, 1, 2)". Is there a way to do the latter?

I'm using OpenGL with JOGL.

Update:

@Bahbar suggests the following:

gl.glLoadIdentity();
gl.glTranslatef(...);

When I do this, everything except six lines disappears. I'm not sure why. I'm having a problem with the far clipping plane being too close, so perhaps they're too far away to be rendered.

+4  A: 

Yes. Just start from the identity matrix.

gl.glLoadIdentity();
gl.glTranslatef(...);
Bahbar
Ok, and how can I get the current position?
Rosarch
@Rosarch There is nothing like the current position, only the translation of the model matrix.
Matias Valdenegro