Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

MausGames

Member Since 11 Apr 2012
Offline Last Active Private
-----

Posts I've Made

In Topic: OpenGL (lwjgl) wont disable texturing

31 January 2013 - 06:02 PM

Do you use glBegin and glEnd ?
Many operations are invalid between those functions - glBindTexture for example returns an GL_INVALID_OPERATION error.
Maybe glEnable and glDisable have a similar behavior.

Edit: Found an old Link to this topic: http://www.gamedev.net/topic/83150-glbindtexture-inside-of-glbegin/

Best regards
- Martin

In Topic: Tilemap problem

30 December 2012 - 05:04 AM

Your glVertex3f-calls look weird. You are drawing quads which get bigger and bigger and this results in z-fighting like on your screenshot.
For example: with (-tileSize*i) you are going left but with (tileSize*i)+tileSize you are going right and therefore stretching the whole quad with each iteration.

Reconsider how you have to place your vertices in order to achieve your goal - try to remove the minus-operators.
Later on you can try to draw triangle-strips which are faster than quads, and even use indices and vertexbuffers.

Best regards
- Martin

In Topic: Rendering Larger Viewport

28 December 2012 - 03:22 PM

http://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml
glFrustum — multiply the current matrix by a perspective matrix

Before applying the frustum-matrix you have to reset the matrix first (glLoadIdentity), push and pop it (glPushMatrix, glPopMatrix) or use some other method (e.g. glLoadMatrix)

Edit: Or more likely you are using glFrustum wrong. The docs say void glFrustum(left, right, bottom, top, nearVal, farVal) - in your example code you are not in the center with your matrix.

- Martin

In Topic: Which situation is more optimal for sprite batching?

27 December 2012 - 05:17 PM

Usually the transformation is calculated outside of the shader, because the shader has to do it repeatedly for each vertex and you have a much better control of the calculations this way. You can also optimize it (e.g. with SSE) for max performance and so the CPU and GPU work perfectly side by side.

There is a nice article from Jari Komppa about this topic: http://sol.gfxile.net/instancing.html

Best regards
- Martin

In Topic: Help! Vehicle Collision Impact Speed

20 May 2012 - 04:54 PM

You can calculate the length of both:
sqrt( x*x + y*y + z*z ) = length

thats basically the speed in your example, but...

if you want to calculate the force, you should get the dot-product between the normalized velocities and the normalized position-difference (during collision):
norm( pos1 - pos2 ) = diff
dot( - diff, norm( v1 ) ) = strength1
dot( + diff, norm( v2 ) ) = strength2

and multiply it with the speed/length value (and maybe with a object-mass).

Maus


btw: http://www.gamedev.net/topic/625147-car-collision-speeds/

PARTNERS