November 24, 2020, 06:41:02 AM

Author Topic: [bb] Furry ball effect by Beaker [ 1+ years ago ]  (Read 770 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Furry ball effect by Beaker [ 1+ years ago ]
« on: June 29, 2017, 12:28:38 AM »
Title : Furry ball effect
Author : Beaker
Posted : 1+ years ago

Description : Creates the effect of fur on nearly any mesh.
Be warned: it's not particularly fast (when compared with doing it with vertex shaders - <a href="http://www.nvidia.com/view.asp?IO=demo_wolfman" target="_blank">nVidia Wolfman[/url]).

Although not essential, the demo uses vertex alpha to enhance the effect.

(Create a splattered/stippled high-contrast image to use as the texture.  Experiment!)


Code :
Code: BlitzBasic
  1. ;MasterBeakers Hairy Balls 2003
  2. ;credit is always nice. :)
  3.  
  4. Graphics3D 640,480
  5. SetBuffer BackBuffer()
  6.  
  7. cam = CreateCamera ()
  8. MoveEntity cam,0,0,-5
  9.  
  10. ball = CreateMesh()
  11. EntityFX ball,32+2
  12.  
  13. ball2 = CreateSphere(5)
  14. ScaleMesh ball2,3,3,3
  15. EntityFX ball2,32+2
  16. ClearTextureFilters
  17.  
  18. tex = LoadTexture ("fur3.bmp",2+1)
  19. EntityTexture ball,tex
  20.  
  21. surf = GetSurface(ball2,1)
  22. For f# = 0 To -0.02 Step -0.001
  23.         ScaleMesh ball2,1.008,1.008,1.008
  24.         RotateMesh ball2,0,-(f*20.0),0
  25.         n# = 1-(-(f)*100.0/2.0)
  26.         For vert = 0 to CountVertices(surf)-1
  27.                 VertexColor surf,vert,255,255,255,n
  28.         Next
  29.         AddMesh ball2,ball
  30. Next
  31. FreeEntity ball2
  32.  
  33. While Not KeyDown(1)
  34.         Flip False
  35.         RenderWorld
  36.         TurnEntity ball,0.03,0.12,0.03
  37. Wend
  38. End


Comments :


puki(Posted 1+ years ago)

 Hey, this is cool.  I have been randomally trying non-standard textures and getting interesting results.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal