Reputation
16,495
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 39 74
Newest
 Nice Answer
Impact
~353k people reached

Jan
10
comment OpenGL - Arcball camera rotation
You can't implement arcball control that way. If you're using pitch and yaw accumulators (such as your 'pPitch' and 'pYaw' values), then you're not building an arcball; you're just using normal euler angles, like you'd see in a ground-based FPS shooter. You already have all the right pieces in your code; you just want to actually render using 'pViewMat' as your view matrix, instead of using 'pPitch' and 'pYaw' to build a new one.
Jan
9
comment OpenGL - Arcball camera rotation
There's not enough information here to actually tell us what problem you're having, but if I was a betting man, I'd bet that you have code not shown that's using those 'pPitch' and 'pYaw' values to set the view matrix, instead of actually using the 'pViewMat' matrix that you set up in Camera::update(). Since your pPitch and pYaw values are crazypants and not actually related to the camera position or target position in any way, that'd explain why the camera isn't pointing at the target.
Jan
9
comment OpenGL - Arcball camera rotation
...you're not doing anything with the 'pPitch' or 'pYaw' values. You put numbers into them and clamp them, but they don't actually influence anything in any of the code you show here.
Jan
5
reviewed Close How to Render an xml tile grid in java
Jan
5
reviewed Close The recommended road map to be a good graphics/game engine programmer
Jan
5
reviewed Close Reflect angle on pong clone
Jan
5
reviewed Close Multi Resolution graphic for ios 4 and ios 5
Jan
5
reviewed Close Drawing visible tiles - side scrolling
Jan
5
reviewed Close Particles in XNA - can't get em to work
Jan
5
reviewed Close client-server network model for top-down WASD game
Jan
5
reviewed Close Which server platform to choose
Jan
5
reviewed Close Looking for Bezier curve OpenGL open source implemention
Jan
5
reviewed Close Deforming meshes in OpenGL
Dec
28
reviewed Close Are there any resources about performance tweaks?
Dec
24
comment What is the cause of this lighting artifact on my dynamic terrain mesh?
So the idea is, if (fabs(TR-BL) < fabs(TL-BR)) { Make BR-BL-TL and BR-TL-TR } else { Make BR-BL-TR and BL-TL-TR }. Any non-planar quad (such as virtually every quad in a heightmap-based terrain) will 'buckle' as it's turned into triangles for rendering, and that 'buckle' will happen along the new triangle edge that you add, so it's going to run diagonally through the quad, one way or the other. The theory is that you get far fewer buckling-related artifacts if you make sure to put that buckle in between the diagonal vertices which are the most similar to each other.
Dec
24
comment What is the cause of this lighting artifact on my dynamic terrain mesh?
@GenericJoe Sure. When you're converting a quad into two triangles, there are two ways you can do it; to use your terminology, you can either do "BR-BL-TL" and "BR-TL-TR", or you can do "BR-BL-TR" and "BL-TL-TR". The first pair of triangles puts the triangle diagonal between TL and BR, while the second pair puts the triangle diagonal between TR and BL. In your code, you always do the first pair of triangles. When I say "choose the closer of the two diagonals", I mean to check whether the change in height between BR and TL is smaller than the change in height between BL and TR.
Dec
24
revised What is the cause of this lighting artifact on my dynamic terrain mesh?
Rewrote first sentence, in light of Josh's edits to the question.
Dec
24
answered What is the cause of this lighting artifact on my dynamic terrain mesh?
Dec
23
comment How to setup glOrtho and Viewport
@AndonM.Coleman I say again: We're going to have to agree to disagree. Please stop posting further comments on my answer.
Dec
23
comment In-development technologies for improvements in video game graphics and design
"The advancement of the arts, from year to year, taxes our credulity and seems to presage the arrival of that period when human improvement must end." -- Henry Ellsworth, Commissioner of the US Patent Office, in a satiric aside to an 1843 report to Congress reporting a new record high in the submission of new inventions.