Interactive PowerBasic Forum

IT-Consultant: Charles Pegge => OxygenBasic Examples => Topic started by: Charles Pegge on February 25, 2024, 01:30:13 AM

Title: Phi Scaling Spheres / Golden Ratio
Post by: Charles Pegge on February 25, 2024, 01:30:13 AM

  $ Title "Phi Scaling. Left button move. Right button rotate"
  uses consoleG
  BeginScript

  procedure main()
  ================
  if opening
  end if
  cls .2,.3,.5
  move 20,-25
  UserMovement m1,100
  '
  '
  shading
  color 1,1,.5,1
  int i
  float phi=1.618033988
  float phm=phi-1
  phi*=3.5 'base scaling factor
  '
  for i=1 to 10
    pushstate
    scale phi
    go sphere
    popstate
    move 0,phi,0
    phi*=phm
    move 0,phi,0
  next
  '
  end procedure 'main

  EndScript