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

Possibly Related Threads…
Thread Author Replies Views Last Post
  WinAPI Mouse Demo Pete 0 196 12-20-2025, 06:40 PM
Last Post: Pete
  BallDraw - simple drawing programing using colored balls Dav 2 405 11-11-2025, 08:57 PM
Last Post: Dav
  12-Way Converter With Mouse SierraKen 7 823 08-23-2025, 09:08 PM
Last Post: SierraKen
  Playing sound files in QB45 eoredson 9 3,033 01-10-2025, 05:37 AM
Last Post: ahenry3068
Star GPT-4o - BBOX Mouse States - Experiment with a diagram to hint at creation of code. grymmjack 10 2,519 08-10-2024, 04:36 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)