You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


1066 star rotation
05-29-2017, 04:31 AM (This post was last modified: 05-29-2017 04:40 AM by bplus.)
Post: #1
 (Print Post)
1066 star rotation
Quote:
hey Mark
this trees rotation is like a huricane - tornado
any way
do you can modify this demo to present galaxy rotation with 1000 stars?

Didn't I do that with Psychedelic Star Swirl? Well here is another go around:

Code Snippet: [Select]
' 1000 star rotation.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-29

sr = 10 : cx = xmax/2 : cy = ymax/2
while 1
  cls
  nstars = 1 : starN = 1
  for s = 1 to sr step 3
    color rgb(rnd*255, rnd*255, rnd *255)
    star cx, cy, .5*s, s, 5, deg(a)*20
  next
  rr = 2 * sr
  while nstars < 1000
    circ = 2 * pi * rr
    n = int(circ / (2*sr))
    for i = 1 to n
      x = cx + rr*cos(i * 2*pi/n + a)
      y = cy + rr*sin(i * 2*pi/n + a)
      starN++
      for s = 1 to sr step 3
        color starN mod 7 + s
        star x, y, .3*s, s, 5, deg(a)*20
      next
    next
    nstars = nstars + n
    rr = rr + 2 * sr
  wend
  color 11
  ? "The number of stars is ";nstars
  showpage
  a = a + pi/360
wend
pause

sub star( x, y, rInner, rOuter, nPoints, angleOffset)
  local pAngle, radAngleOffset, i, x1, y1, x2, y2, x3, y3
  ' x, y are same as for circle,
  ' rInner is center circle radius
  ' rOuter is the outer most point of star
  ' nPoints is the number of points,
  ' angleOffset = angle offset IN DEGREES, it will be converted to radians in sub
  ' this is to allow us to spin the polygon of n sides
  pAngle = RAD(360 / nPoints)  :  radAngleOffset = RAD(angleOffset)
  x1 = x + rInner * cos(radAngleOffset)
  y1 = y + rInner * sin(radAngleOffset)
  for i = 0 to nPoints - 1
    x2 = x + rOuter * cos(i * pAngle + radAngleOffset + .5 * pAngle)
    y2 = y + rOuter * sin(i * pAngle + radAngleOffset + .5 * pAngle)
    x3 = x + rInner * cos((i + 1) * pAngle + radAngleOffset)
    y3 = y + rInner * sin((i + 1) * pAngle + radAngleOffset)
    line x1, y1, x2, y2
    line x2, y2, x3, y3
    x1 = x3 : y1 = y3
  next
end sub


Attached File(s) Image(s)
   

B += _
Find all posts by this user
Like Post
05-29-2017, 06:28 AM
Post: #2
 (Print Post)
RE: 1066 star rotation
probably not the comment you were looking for, but in gnu/linux that filepath would be

/home/Mark/Desktop/1000 star swirl.bas
Find all posts by this user
Like Post
05-29-2017, 01:25 PM (This post was last modified: 05-29-2017 02:08 PM by bplus.)
Post: #3
 (Print Post)
RE: 1066 star rotation
Yeah, I was hoping for advice to make it 3d or a singularity!

OK Aurel, it is all up to YOU!

(not really, I have some ideas for 3d already.)

B += _
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Martin Fractals version four
QB64 Member Project - Swirl
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Input
QB64 Member Project - Inside Moves
QB64 Member Project - Splatter
QB64 Member Project - Spiro Roses
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Amazon
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Foursight
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Domain
QB64 Member Project - Qubic
QB64 Member Project - Color Triangles
QB64 Member Project - Basic Dithering
QB64 Member Project - Point Blank
QB64 Member Project - Dreamy Clock
QB64 Member Project - Martin Fractals version one
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Pivet version one
QB64 Member Project - Dakapo
QB64 Member Project - Touche
QB64 Member Project - ARB Checkers
QB64 Member Project - Pivot version two
QB64 Member Project - Score 4
QB64 Member Project - Full Color LED Sign
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Kings Valley verion one
QB64 Member Project - Othello
QB64 Member Project - Rotating Background
QB64 Member Project - 9 Board
QB64 Member Project - Overboard
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Isolation
QB64 Member Project - Rubix's Magic
QB64 Member Project - Kings Court
QB64 Member Project - Exit
QB64 Member Project - Quarto
QB64 Member Project - Bowditch curve
QB64 Member Project - Color Rotating Text
QB64 Member Project - Connect Four
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Line Thickness
QB64 Member Project - Algeria Weather
QB64 Member Project - Sabotage
QB64 Member Project - Blokus