Search Results

Search found 1 results on 1 pages for 'user578954'.

Page 1/1 | 1 

  • 3d movement around a sphere

    - by user578954
    Hey guys, Im working in 3d for the first time in a long time. Basically im rotating a sphere and projecting x y z cords to place things on the surface based on the spheres X and Y rotation. Heres the code im using: #define piover180 0.01745329252f GLfloat cosy = cos(yrot * piover180); island[i].x = rad * sin(xrot * piover180)* cosy; island[i].y = rad * sin(yrot * piover180); island[i].z = rad * cos(xrot * piover180) * cosy; Problem is the Xrot positioning works fine but the Yrot placement always draw the objects into the north and south pole so they all cross at the top, which isnt correct for rotating. I need a way to solve this. Heres a picture to help explain http://llllost.com/shuttle/47bcde62.jpg Any help would be greatly appreciated, let me know if you need any more information

    Read the article

1