Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MouseyBalls, playing with balls using mouse (repel/attract)
#2
Here's a GL Ball for you to play with and get hypnotised by, @Dav 

Code: (Select All)
Screen _NewImage(600, 600, 32)
Type vec3
    x As Single
    y As Single
    z As Single
End Type
Do
    _Delay 0.05
Loop Until InKey$ <> ""

Sub _GL ()
    Dim center As vec3, vertex As vec3, radius
    center.x = 0
    center.y = 0
    center.z = 0
    radius = 1
    _glPointSize 5.0
    _glRotatef Timer * 30, 1, 2, 0
    _glBegin _GL_POINTS
    For theta = 0 To _Pi Step _Pi / 50
        For phi = 0 To _Pi(2) Step _Pi(2) / 100
            vertex.x = center.x + Sin(theta) * Cos(phi) * radius
            vertex.y = center.y + Sin(theta) * Sin(phi) * radius
            vertex.z = center.z + Cos(theta) * radius
            _glVertex3f vertex.x, vertex.y, vertex.z
        Next phi
    Next theta
    _glEnd
End Sub
Reply


Messages In This Thread
RE: MouseyBalls, playing with balls using mouse (repel/attract) - by SMcNeill - 10-13-2023, 10:03 PM



Users browsing this thread: 2 Guest(s)