VisClient/org/hfbk/vis/visnode/VisRiver.java

Go to the documentation of this file.
00001 package org.hfbk.vis.visnode;
00002 
00003 import org.dronus.graph.Node;
00004 import org.lwjgl.opengl.GL11;
00005 import org.lwjgl.util.vector.Vector3f;
00006 
00007 public class VisRiver extends VisHeightfield {
00008         public VisRiver(Node node, Vector3f position) {
00009                 super(node, position);
00010         }
00011         float t;
00012         @Override
00013         float[][] heightMap(float t) {
00014                 int w=100, h=100;
00015                 t+=getRoot().client.dt;
00016                 float[][]z=     new float[w][h]; 
00017                 
00018                 for (int x = 0; x < w; x++)
00019                         for (int y = 0; y < h; y++) 
00020                                 z[x][y]=(float)(Math.sin(x+t)+Math.sin(y+t*1.3));
00021                                 
00022                 return z;
00023         }
00024         @Override
00025         void renderSelf() {
00026                 
00027                 radius=10000;
00028 //              GL11.glScalef(10f, .4f, 2f);
00029                 GL11.glTranslatef(0, 0, 60);
00030                 GL11.glScalef(10f, .4f, -5f);
00031                 
00032                 GL11.glDisable(GL11.GL_TEXTURE_2D);
00033                 GL11.glColor3f(1, 1, 1);
00034                 super.renderSelf();
00035         }
00036 }

Generated on Tue Apr 7 17:57:22 2009 for visclient by  doxygen 1.5.1