Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Take a look at this function calls (disclaimer: untested - I haven't used LWJGL, but the concept should be identical):</p> <pre><code>GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glRotate(90, 0, 0, 1); // (1) Here you transform texture space GL11.glMatrixMode(GL11.GL_MODELVIEW); // and so on </code></pre> <p>Basically, you need to rotate texture on object. And that's the way you do it - transform texture projection matrix. The line (1) rotates texture 90 degrees along Z axis (perpendicular to texture plane). It's Z axis, because the last argument is 1. Last three arguments denote X, Y and Z respectively (I'll leave the whole explanation for later if you're interested).</p> <p>The best You can do is to grasp all the basic stuff (projection, texture space, normal vectors, triangulation, continuity, particle systems and a lot more) is to download some trial version of a 3d package and play with it. I learned a lot just out of playing with 3D Studio Max (trial version available, and many more for free). If you have some free time and will to learn something new I strongly advise to look into it. In the end, if You're really interested in 3D graphics You'll end up using one any way - be it 3d package or game engine level editor.</p> <p>EDIT: After more reading I recognized my own code... Basically you could only swap some of the coordinates to reflect symmetrically along diagonal. You might end up upside down, but that can also be fixed with additional tweaking (or transforming the view axis). Here is my untested guess:</p> <pre><code>// tweaked to get pole right s1 = ((double) j) / longs; s2 = ((double) j + 1) / longs; t = ((double) i) / halfLats; </code></pre> <p>Try swapping s1 with s2 if it's not right.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload