B4J Tutorial CausticRaysCircle

Have converted this Processing Github Project to B4J. Very interesting to watch this being drawn in real time. Just B4J default libs required.

Have not used the default Processing PVector library for the project - have hard coded the Vector multiplication, subtraction, addition, dot product, magnitude, normalization, etc inside the B4J project.

Enjoy!

50 rays
50 rays.png


100 rays
100 rays.png


1000 rays
1000 rays.png
 

Attachments

  • b4jCausticRaysCircle.zip
    2.6 KB · Views: 61
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Nice! 🙂

Here's a channel with these kinds of animations

Such as this one
A very rough draft of a ray bouncing inside an ellipse with equation 4x^2 + y^2 = 100
It is based on this web posting

Starting point and first bounce:
    fromPoint.x = 0
    fromPoint.y = 10.1
  
    toPoint.x = 1.4
    toPoint.y = -9.6


check.png
 

Attachments

  • b4jEllipseNew.zip
    3.8 KB · Views: 33

Johan Schoeman

Expert
Licensed User
Longtime User
The attached B4J project will randomly select a ray starting point and then a randomly selected "first bounce" point and then continue to bounce the ray according to the "laws of reflection inside an ellipse". It draws some interesting patterns inside the ellipse baaed on the randomly selected start and first-bounce points.

Makes me wonder why the Oval Office is an oval office....?
 

Attachments

  • b4jEllipseNew.zip
    3.9 KB · Views: 28
Last edited:
Top