Skip to content
Snippets Groups Projects
Commit 7a175af4 authored by Johannes Eder's avatar Johannes Eder
Browse files

RED

refs 862
parent 722b90d3
No related branches found
No related tags found
No related merge requests found
......@@ -79,11 +79,15 @@ public class Camera {
/** Applies the camera position and view target to GL before rendering starts. */
public void applyForRendering() {
gluLookAt(pos.x, pos.y, pos.z, target.x, target.y, target.z, 0, 0, 1.0f);
gluLookAt(pos.x, pos.y, pos.z, target.x, target.y, target.z, 0, 0, 1.0f); // TODO (JE): move
// to
// GLPrimitives
}
/** Applies the camera position and view target to GL before picking starts. */
public void applyForPicking() {
gluLookAt(pos.x, pos.y, pos.z, target.x, target.y, target.z, 0, 0, 1.0f);
gluLookAt(pos.x, pos.y, pos.z, target.x, target.y, target.z, 0, 0, 1.0f);// TODO (JE): move
// to
// GLPrimitives
}
}
......@@ -96,7 +96,7 @@ public class MovingCameraWithPitchAndYaw extends Camera {
@Override
public void applyForRendering() {
// from origin look at Y axis
gluLookAt(0, 0, 0, 0, 1.0f, 0, 0, 0, 1.0f);
gluLookAt(0, 0, 0, 0, 1.0f, 0, 0, 0, 1.0f);// TODO (JE): move to GLPrimitives
rotate(pitchAngle, X_UNIT_VECTOR);
rotate(yawAngle, Z_UNIT_VECTOR);
translate(-pos.x, -pos.y, -pos.z);
......@@ -111,12 +111,12 @@ public class MovingCameraWithPitchAndYaw extends Camera {
/** {@inheritDoc} */
@Override
public void setTarget(float tx, float ty, float tz) {
throw new UnsupportedOperationException();
throw new UnsupportedOperationException(); // TODO (JE): call super method instead of exception?
}
/** {@inheritDoc} */
@Override
public void alterTarget(float dx, float dy, float dz) {
throw new UnsupportedOperationException();
throw new UnsupportedOperationException(); // TODO (JE): call super method instead of exception?
}
}
......@@ -107,7 +107,11 @@ public class LwjglCanvas extends GLCanvas {
}
/** Buffer for loaded fonts. */
private final Map<Font, TrueTypeFont> fontMap = new HashMap<Font, TrueTypeFont>();
private final Map<Font, TrueTypeFont> fontMap = new HashMap<Font, TrueTypeFont>(); // TODO (JE):
// Perhaps
// use
// UnicodeFont
// instead?
/** Ensures that fonts are ready for use. */
private void ensureFontLoading(Font font) {
......
......@@ -52,7 +52,7 @@ import org.lwjgl.util.vector.Vector3f;
* mouse and key events by overriding the respective methods.
* <P>
* The rendering process is started by calling {@link #beginRenderLoop()}, which allows sub-classes
* to apply additional GL setup commands. Sub-classes maya change the perspective by overriding
* to apply additional GL setup commands. Sub-classes may change the perspective by overriding
* {@link #getPerspective()} and return a vector with the field of view, Z near distance, and Z far
* distance. Note that all three must be greater zero.
* <P>
......
......@@ -55,7 +55,10 @@ public class Light {
Vector3D attenuation) {
glLightNumber = glLight;
setLightColor(ambient, diffuse, specular);
lightPosition = toFloatBuffer(new float[] {1.0f, 1.0f, 1.0f, 1.0f});
lightPosition = toFloatBuffer(new float[] {1.0f, 1.0f, 1.0f, 1.0f}); // TODO (JE): comment
// above says
// lightPosition
// is (1,1,1)
this.attenuation = attenuation;
}
......
......@@ -90,6 +90,7 @@ public final class ModelObjectPicker {
viewport.clear();
selectBuffer.clear();
// TODO (JE): perhaps move all gl methods below to GLPrimitves for better understanding
glGetInteger(GL_VIEWPORT, viewport);
float aspect =
(float)(viewport.get(2) - viewport.get(0)) /
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment