July 13, 2024, 06:49:54 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Morphing Dots

Started by Steven Picard, November 26, 2006, 05:27:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Steven Picard

Another great example from the off-line forum. This was written by Mark1up:

' Morphing Dots
' translated to IBasic Pro
DEF c,n,cnt,object,x3d,y3d,z3d,t,q,nx,ny,speed:INT
DEF vx,sinvx,cosvx,vy,sinvy,cosvy,vz,sinvz,cosvz,tx,ty,tz,ox:FLOAT
CONST numdots=10000
CONST numobjs=20
CONST distance=400
CONST ESC = &H1B
CONST scrnw = 1024
CONST scrnh = 768
CONST xhalf = scrnw/2
CONST yhalf = scrnh/2
DEF points[numdots+1,4],tpoint[numdots+1,4]:INT
object=1
cnt=0
getobject(object)
IF CREATESCREEN(scrnw,scrnh,32,&WinProc) < 0 
MESSAGEBOX 0,"Unable to create DirectX screen!","Error!" 
END 
ENDIF
Run=1
Do
cnt=cnt+1
   If cnt>299
     object=object+1
     If object>numobjs
        object=1
     EndIf
     getobject(object)
     cnt=0
   EndIf
   morphing()
   threed()
   WRITETEXT xhalf-110,20, "IBasic Pro - Morphing Dots"
   WRITETEXT xhalf-50,50, "FPS= "+STR$(speed)
   speed = FLIP 1
   for n=1 to speed*70000
   next n
   FILLSCREEN 0
Until run=0
CLOSESCREEN 
END 

SUB WinProc 
   SELECT @CLASS
     CASE @IDCLOSEWINDOW 
      Run = 0 
     CASE @IDCHAR 
      IF @CODE = ESC
        ' End the program 
        Run = 0 
      ENDIF 
    ENDSELECT 
   RETURN 
ENDSUB
SUB threed()
vx=vx+0.05
vy=vy+0.05
vz=vz+0.05
sinvx=sin(vx)
cosvx=cos(vx)
sinvy=sin(vy)
cosvy=cos(vy)
sinvz=sin(vz)
cosvz=cos(vz)
Lockbuffer
For n=1 To numdots
  x3d=tpoint[n,1]
  y3d=tpoint[n,2]
  z3d=tpoint[n,3]
  ty=y3d*cosvx-z3d*sinvx
  tz=y3d*sinvx+z3d*cosvx
  tx=x3d*cosvy-tz*sinvy
  tz=x3d*sinvy+tz*cosvy
  ox=tx
  tx=tx*cosvz-ty*sinvz
  ty=ox*sinvz+ty*cosvz
  nx=scrnh*tx/(distance-tz)+xhalf
  ny=yhalf-scrnh*ty/(distance-tz)
  if tz<=200 and tz>=75
   c=255
  endif
  if tz<75 and tz>-175
   c=tz+180
  endif
  if tz<=-175 and tz>=-200
   c=5
  endif
  WRITEPIXEL(nx,ny, RGB(c,c,c))
Next n
Unlockbuffer
RETURN
ENDSUB
SUB getobject(obj:int)
Select obj
  Case 1
   For t=1 To numdots-1
    points[t,1]=(RAND(1800)-900)/10*t/numdots
    points[t,2]=(RAND(1800)-900)/10*t/numdots
    points[t,3]=(RAND(1800)-900)/10*t/numdots
   Next t
  Case 2
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,2]=Cos(xd)*Sin(t*360/numdots)*100
    points[t,3]=Sin(xd)*100
   Next t
  Case 3
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,2]=Cos(xd)*Sin(t*360/numdots)*100
    points[t,3]=Sin(t*360/numdots)* 100
   Next t
  Case 4
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Sin(t*360/numdots)*Cos(t*360/numdots)*100
    points[t,2]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 5
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(xd)*100
    points[t,2]=Cos(xd)*Sin(xd)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 6
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(xd)*100
    points[t,2]=Cos(t*360/numdots)*Sin(xd)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 7
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(t*360/numdots)*Cos(t*360/numdots)*100
    points[t,2]=Cos(t*360/numdots)*Sin(xd)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 8
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,2]=Cos(xd)*Sin(t*360/numdots)*100
    points[t,3]=Sin(xd)*Sin(t*360/numdots)*100
   Next t
  Case 9
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Sin(t*360/numdots)*Cos(t*360/numdots)*Sin(xd)*100
    points[t,2]=Cos(t*360/numdots)*Sin(xd)*Cos(xd)*100
    points[t,3]=Sin(xd)*Cos(t*360/numdots)*100
   Next t
  Case 10
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,2]=Cos(t*360/numdots)*Sin(xd)*100
    points[t,3]=Cos(xd)*Sin(xd)*100
   Next t
  Case 11
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(t*360/numdots)*Cos(xd)*100
    points[t,2]=Cos(xd)*Sin(xd)*100
    points[t,3]=Sin(xd)*100
   Next t
  Case 12
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,2]=Sin(xd)*Sin(t*360/numdots)*100
    points[t,3]=Sin(xd)*100
   Next t
  Case 13
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(t*360/numdots)*Cos(xd)*100
    points[t,2]=Sin(t*360/numdots)*Sin(xd)*100
    points[t,3]=Sin(t*360/numdots)*Sin(xd)*Cos(t*360/numdots)*Cos(xd)*200
   Next t
  Case 14
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(xd)*100
    points[t,2]=Sin(t*360/numdots)*Sin(xd)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 15
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Sin(xd)*Cos(xd)*100
    points[t,2]=Sin(xd)*Sin(t*360/numdots)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 16
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,2]=Cos(t*360/numdots)*Sin(t*360/numdots)*100
    points[t,3]=Sin(xd)*Cos(t*360/numdots)*100
   Next t
  Case 17
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(t*360/numdots)*Sin(t*360/numdots)*100
    points[t,2]=Sin(t*360/numdots)*Sin(xd)*Cos(t*360/numdots)*100
    points[t,3]=Sin(xd)*Cos(t*360/numdots)*100
   Next t
  Case 18
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Cos(xd)*100
    points[t,2]=Cos(t*360/numdots)*Sin(t*360/numdots)*100
    points[t,3]=Sin(t*360/numdots)*100
   Next t
  Case 19
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Cos(xd)*Sin(t*360/numdots)*100
    points[t,2]=Cos(xd)*Cos(t*360/numdots)*100
    points[t,3]=Cos(xd)*100
   Next t
  Case 20
   For t=1 To numdots
    xd=RAND(1800)
    points[t,1]=Sin(xd)*Cos(xd)*Sin(t*360/numdots)*200
    points[t,2]=Sin(t*360/numdots)*Cos(t*360/numdots)*Sin(xd)*200
    points[t,3]=Sin(t*360/numdots)*Cos(xd)*Cos(t*360/numdots)*200
   Next t
EndSelect   

RETURN
ENDSUB
SUB morphing()
For t=1 To numdots
  For q=1 To 3
   If points[t,q]>tpoint[t,q]
    tpoint[t,q]=tpoint[t,q]+1
   Endif
   IF points[t,q]<tpoint[t,q]
    tpoint[t,q]=tpoint[t,q]-1
   Endif
  Next q
Next t
RETURN
ENDSUB

GWS

Hi Steven,

Here's the color version .. takes a few seconds to get going ..  :)

best wishes,

Graham
Tomorrow may be too late ..

Jolly_Roger

This is the anaglyph version. If you wear a pair of those silly 3D glasses with red over the left eye and blue over the right you will see it in 3D.


' Morphing Dots
' translated to IBasic Pro by Mark1up
' Minor modification to make anaglyph by Jolly Roger

DEF c,n,cnt,object,x3d,y3d,z3d,t,q,nx,ny,speed:INT
DEF vx,sinvx,cosvx,vy,sinvy,cosvy,vz,sinvz,cosvz,tx,ty,tz,ox:FLOAT

DEF sinyangleoffset,cosyangleoffset,yangleoffset:FLOAT
DEF pixelcolour,red,green,blue:INT

'Set angle offset between red and blue images
'If zero then no 3D effect,if too great then image hard to view
yangleoffset=-.1


sinyangleoffset=SIN(yangleoffset)
cosyangleoffset=COS(yangleoffset)

DEF lastframetime,timesincelastframe,time,lastobjecttime:INT
'Set up Timer
Declare "Kernel32",GetTickCount(),INT

CONST numdots=10000
CONST numobjs=20
CONST distance=400
CONST ESC = &H1B
CONST scrnw = 1024
CONST scrnh = 768
CONST xhalf = scrnw/2
CONST yhalf = scrnh/2

DEF points[numdots+1,4],tpoint[numdots+1,4]:INT

object=3

getobject(object)

IF CREATESCREEN(scrnw,scrnh,32) < 0ÂÃ, 
MESSAGEBOX 0,"Unable to create DirectX screen!","Error!"ÂÃ, 
ENDÂÃ, 
ENDIF

'Hide cursor
SETCURSOR FrontBuffer,@CSCUSTOM,0

Run=1
lastframetime=GetTickCount()
lastobjecttime=GetTickCount()
'Main loop
Do
time=GetTickCount()
timesincelastframe=time-lastframetime
IF timesincelastframe>2
ÂÃ,  ÂÃ, lastframetime=time
ÂÃ,  ÂÃ, If time-lastobjecttime>10000
ÂÃ,  ÂÃ,  ÂÃ, '10s since last changed object.Change it again
ÂÃ,  ÂÃ,  ÂÃ, object=object+1
ÂÃ,  ÂÃ,  ÂÃ, If object>numobjs THEN object=1
ÂÃ,  ÂÃ,  ÂÃ, getobject(object)
ÂÃ,  ÂÃ,  ÂÃ, lastobjecttime=time
ÂÃ,  ÂÃ, EndIf
ÂÃ,  ÂÃ, FILLSCREEN 0
ÂÃ,  ÂÃ, morphing()
ÂÃ,  ÂÃ, threed()
ÂÃ,  ÂÃ, WRITETEXT xhalf-160,20, "IBasic Pro - Morphing Dots. Press Esc to exit"
ÂÃ,  ÂÃ, WRITETEXT xhalf-50,50, "FPS= "+STR$(speed)
ÂÃ,  ÂÃ, speed = FLIP 1
ENDIF
Until KEYDOWN(1)

CLOSESCREENÂÃ, 
END



SUB threed()
vx=vx+timesincelastframe*.0008
vy=vy+timesincelastframe*.0008
vz=vz+timesincelastframe*.0008ÂÃ, 
sinvx=sin(vx)
cosvx=cos(vx)
sinvy=sin(vy)
cosvy=cos(vy)
sinvz=sin(vz)
cosvz=cos(vz)
Lockbuffer
For n=1 To numdots
ÂÃ,  x3d=tpoint[n,1]
ÂÃ,  y3d=tpoint[n,2]
ÂÃ,  z3d=tpoint[n,3]
ÂÃ,  ty=y3d*cosvx-z3d*sinvx
ÂÃ,  tz=y3d*sinvx+z3d*cosvx
ÂÃ,  tx=x3d*cosvy-tz*sinvy
ÂÃ,  tz=x3d*sinvy+tz*cosvy
ÂÃ,  ox=tx
ÂÃ,  tx=tx*cosvz-ty*sinvz
ÂÃ,  ty=ox*sinvz+ty*cosvz
ÂÃ,  nx=scrnh*tx/(distance-tz)+xhalf
ÂÃ,  ny=yhalf-scrnh*ty/(distance-tz)
ÂÃ,  if tz<=200 and tz>=75
ÂÃ,  ÂÃ, c=255
ÂÃ,  endif
ÂÃ,  if tz<75 and tz>-175
ÂÃ,  ÂÃ, c=tz+180
ÂÃ,  endif
ÂÃ,  if tz<=-175 and tz>=-200
ÂÃ,  ÂÃ, c=5
ÂÃ,  endif
ÂÃ,  'Find current colour of pixel
ÂÃ,  pixelcolour=READPIXEL(nx,ny)
ÂÃ,  red=pixelcolour&255:blue=pixelcolour/0x10000
ÂÃ,  'Set new pixel colour to be combination of red and blue
ÂÃ,  'already there plus red for the new dot
ÂÃ,  WRITEPIXELFAST(nx,ny, RGB(red|c,0,blue))

ÂÃ,  'Rotate object slightly around vertical axis by yangleoffset
ÂÃ,  'then draw dot in blue
ÂÃ,  tx=tx*cosyangleoffset+tz*sinyangleoffset
ÂÃ,  tz=tz*cosyangleoffset+tx*sinyangleoffset
ÂÃ,  nx=scrnh*(tx+5)/(distance-tz)+xhalf
ÂÃ,  ny=yhalf-scrnh*ty/(distance-tz)
ÂÃ,  'Find current colour of pixel
ÂÃ,  pixelcolour=READPIXEL(nx,ny)
ÂÃ,  red=pixelcolour&255:blue=pixelcolour/0x10000
ÂÃ,  'Set new pixel colour to be combination of red and blue
ÂÃ,  'already there plus blue for the new dot
ÂÃ,  WRITEPIXELFAST(nx,ny, RGB(red,0,blue|c))
Next n
Unlockbuffer
RETURN
ENDSUB



SUB getobject(obj:int)
Select obj
ÂÃ,  Case 1
ÂÃ,  ÂÃ, For t=1 To numdots-1
ÂÃ,  ÂÃ,  points[t,1]=(RAND(1800)-900)/10*t/numdots
ÂÃ,  ÂÃ,  points[t,2]=(RAND(1800)-900)/10*t/numdots
ÂÃ,  ÂÃ,  points[t,3]=(RAND(1800)-900)/10*t/numdots
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 2
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 3
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)* 100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 4
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Sin(t*360/numdots)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 5
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 6
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(t*360/numdots)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 7
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(t*360/numdots)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(t*360/numdots)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 8
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 9
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Sin(t*360/numdots)*Cos(t*360/numdots)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(t*360/numdots)*Sin(xd)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 10
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(t*360/numdots)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Cos(xd)*Sin(xd)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 11
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(t*360/numdots)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 12
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Sin(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 13
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(t*360/numdots)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Sin(t*360/numdots)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*Sin(xd)*Cos(t*360/numdots)*Cos(xd)*200
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 14
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Sin(t*360/numdots)*Sin(xd)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 15
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Sin(xd)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Sin(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 16
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(t*360/numdots)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 17
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(t*360/numdots)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Sin(t*360/numdots)*Sin(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 18
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Cos(xd)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(t*360/numdots)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 19
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Cos(xd)*Sin(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,2]=Cos(xd)*Cos(t*360/numdots)*100
ÂÃ,  ÂÃ,  points[t,3]=Cos(xd)*100
ÂÃ,  ÂÃ, Next t
ÂÃ,  Case 20
ÂÃ,  ÂÃ, For t=1 To numdots
ÂÃ,  ÂÃ,  xd=RAND(1800)
ÂÃ,  ÂÃ,  points[t,1]=Sin(xd)*Cos(xd)*Sin(t*360/numdots)*200
ÂÃ,  ÂÃ,  points[t,2]=Sin(t*360/numdots)*Cos(t*360/numdots)*Sin(xd)*200
ÂÃ,  ÂÃ,  points[t,3]=Sin(t*360/numdots)*Cos(xd)*Cos(t*360/numdots)*200
ÂÃ,  ÂÃ, Next t
EndSelectÂÃ,  ÂÃ, 
ÂÃ, 
RETURN
ENDSUB



SUB morphing()
For t=1 To numdots
ÂÃ,  For q=1 To 3
ÂÃ,  ÂÃ, If points[t,q]>tpoint[t,q]
ÂÃ,  ÂÃ,  tpoint[t,q]=tpoint[t,q]+1
ÂÃ,  ÂÃ, Endif
ÂÃ,  ÂÃ, IF points[t,q]<tpoint[t,q]
ÂÃ,  ÂÃ,  tpoint[t,q]=tpoint[t,q]-1
ÂÃ,  ÂÃ, Endif
ÂÃ,  Next q
Next t
RETURN
ENDSUB


Jerry Muelver

Red-blue 3D glasses available at http://www.anachrome.com/
I can see cross-view 3D with no assistance, but gotta have glasses for the red-blue stuff.