27

Depth of Field

 4 years ago
source link: https://www.tuicool.com/articles/aQV7VfU
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The following is the outline of the methodused to render the webs, as well as the images you see here, that does not involve building meshes. It should work for a wide range of graph structures, and probably other things as well.

Assumingyou have:

  • A line in 3D, l=[a, b] ;
  • a camera at position, c ;
  • a focus distance from camera, f
  • a distance function, dst(a, b) that yields the distance between a and b ;
  • a function, lerp(a, b, s) = a + s*(b-a) , which interpolates between a and b ;
  • a function, rnd() , that yields random numbers between 0 and 1 ; and
  • a function, rndSphere(r) , that returns random points inside a sphere with radius, r .

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK