de.beamertool.viewer.gui.opengl
Class PhotoCube

java.lang.Object
  extended by de.beamertool.viewer.gui.opengl.PhotoCube

public class PhotoCube
extends Object

A simple representation of a cube with photos plastered on each of the six faces.

Author:
Chris Campbell, Sebastian Just

Constructor Summary
PhotoCube(Settings theSettings)
          Default constructor.
 
Method Summary
 float getAlpha()
           
 float getSize()
           
 void initTextures()
          Loads each of the six images into texture memory.
 void nextTexture()
           
 void render(GL gl)
          Renders the cube into the given graphics context.
 void setAlpha(float alpha)
           
 void setSize(float size)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhotoCube

public PhotoCube(Settings theSettings)
Default constructor. Initializes the size to 10f and alpha to 1f.

Method Detail

getAlpha

public float getAlpha()

getSize

public float getSize()

initTextures

public void initTextures()
Loads each of the six images into texture memory. REMIND: This method currently uses hardcoded filenames. For extra credit, one could pass these names as method parameters, to allow for loading the images from other locations, e.g. from the disk or over the network.


nextTexture

public void nextTexture()

render

public void render(GL gl)
Renders the cube into the given graphics context. The current OpenGL transformation matrix determines where the cube is positioned in world coordinates.


setAlpha

public void setAlpha(float alpha)

setSize

public void setSize(float size)