Roi Atalla avatar Roi Atalla committed d79e284

I'm going to stop. Now.

Comments (0)

Files changed (1)

src/main/java/com/ra4king/opengl/test/Test.java

 		angleY -= turnSpeed * Mouse.getDY() / 20f;
 		
 		if(Keyboard.isKeyDown(Keyboard.KEY_A))
+			position.add((float)Math.cos(angle+Math.PI)*moveSpeed, 0, (float)Math.sin(angle+Math.PI)*moveSpeed);
+		if(Keyboard.isKeyDown(Keyboard.KEY_D))
 			position.sub((float)Math.cos(angle+Math.PI)*moveSpeed, 0, (float)Math.sin(angle+Math.PI)*moveSpeed);
-		if(Keyboard.isKeyDown(Keyboard.KEY_D))
-			position.add((float)Math.cos(angle+Math.PI)*moveSpeed, 0, (float)Math.sin(angle+Math.PI)*moveSpeed);
 		
 		if(Keyboard.isKeyDown(Keyboard.KEY_W))
+			position.sub((float)Math.cos(angle+Math.PI/2)*moveSpeed, 0, (float)Math.sin(angle+Math.PI/2)*moveSpeed);
+		if(Keyboard.isKeyDown(Keyboard.KEY_S))
 			position.add((float)Math.cos(angle+Math.PI/2)*moveSpeed, 0, (float)Math.sin(angle+Math.PI/2)*moveSpeed);
-		if(Keyboard.isKeyDown(Keyboard.KEY_S))
-			position.sub((float)Math.cos(angle+Math.PI/2)*moveSpeed, 0, (float)Math.sin(angle+Math.PI/2)*moveSpeed);
 		
 		if(Keyboard.isKeyDown(Keyboard.KEY_R))
 			position.reset();
 		
 		if(position.y() < 0) {
 			position.y(0);
-			vy = -vy/3f;
+			vy = -vy/2f;
 		}
 	}
 	
 		
 		glBindVertexArray(vao);
 		for(int a = -100; a <= 100; a++) {
+			if(a == 0)
+				continue;
+			
 			for(int b = -100; b <= 0; b++) {
-				glUniformMatrix4(modelViewMatrixUniform, false, modelViewMatrix.clearToIdentity().rotate(angleY, 1, 0, 0).rotate(angle,0,1,0).translate(a*10 + position.x(), -20 - position.y(), b*10-20 + position.z()).getBuffer());				
+				if(b == -50)
+					continue;
+				
+				glUniformMatrix4(modelViewMatrixUniform, false, modelViewMatrix.clearToIdentity().rotate(angleY, 1, 0, 0).rotate(angle,0,1,0).translate(a*10 - position.x(), -20 - position.y(), b*10-20 - position.z()).getBuffer());				
 				glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_SHORT, 0);
 			}
 		}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.