Hello JGO!
I thought I wouldn't be asking another newb question for a while, but I got SFX greedy.
For my intro of my game, I want the earth and sun spinning around, and, I could draw an undynamic animation or array of .png files, or I could draw a sphere to do it for me, and considering it's going to be the only 3D in my game (planned so far), it shouldn't be too bad to implement.
A few problems with the code below:
* It uses the slick Texture to bind to the glu.sphere, but it only shows the average colour- there is only 1 colour.
* I cannot understand how to map the texture if I got it working
* Only the leftmost and rightmost pixels are processed from the .png to the sphere
* Transparency only whitens the sphere.
1 2 3 4 5 6 7 8 9 10
| private static Texture image; private void renderSphere(float x, float y, float z) { image.bind(); glPushMatrix(); glTranslatef(x, y, z); Sphere s = new Sphere(); s.draw(0.4f, 16, 16); glPopMatrix(); } |
So any ideas? I cannot understand how it does work.