3D Polygon Engine #6 - Multiple Cube Follow Orientation Curve
2022-12-08. I have implemented the common "Look At" functionality to orient a 3D object in 3D space to face in a particular direction. In this case, using the Cube shape for each object, I ask each Cube to face the direction of the curve it happens to live on. All 5,000 cubes are being rendered each frame, intersecting each other. I did this to test the method's accuracy, and noticed it made a very smooth looking surface. While not as nice if I simply parameterized the curve and constructed a single polygon object from it -- since there is a ton of Z-fighting and graphic artifacts, along with the cube faces being flat and not curving as they intersect -- it still makes for a cool demo.
What you see is 5,000 cubes in a given 3-layer Sine wave created curve, that expand in distance from each other, until a threshold is met at exactly 45 seconds in, and then the motion continues without further expansion. You can see the cube curve head growing in the motion at the front, and its tail being eaten up behind.
The curve also shows off the XNA / MonoGame default lighting using BasicEffect, which has specular highlights. It is also using per pixel lighting for Phong shading.
Please see my other 3D polygon demos in this playlist to see more of the Platonic solids:
- Tetrahedron - 4 faces - triangles
- Cube - 6 faces - squares
- Octahedron - 8 faces - triangles
- Dodecahedron - 12 faces - pentagons
- Icosahedron - 20 faces - triangles
Playlists:
--------------------
- Polygon 3D: https://youtube.com/watch?v=0Qq_euAMP48&list=PLjnbT4UISq0YyjqBGG8Q34Kng5gqDmYrT
- Voxel Software 3D: https://youtube.com/watch?v=uadGU-stF-w&list=PLjnbT4UISq0bQF1g85tE9jTrKfEtdRYlY
- Ray Casting 3D: https://youtube.com/watch?v=SkaPYZOKPQg&list=PLjnbT4UISq0YcFtRFjFQqK0g6ONNCtrvY
- Graph-All Calculator 2D: https://youtube.com/watch?v=kLSc7bZW2Bs&list=PLjnbT4UISq0YLgynFSpLzml4BMC6TDZL2
- Parallax Side-Scroll Shooter 2D: https://youtube.com/watch?v=l9bIYkZepPo&list=PLjnbT4UISq0Y_7IAN_zUzxgZnfhXxo_0Q
- Road Pseudo 3D: https://youtube.com/watch?v=rA4g4VX7ys8&list=PLjnbT4UISq0bnfd1RC3M4PgTgkmhlkikV
- Arena Shooter 2D: https://youtube.com/watch?v=VKjiuq437t0&list=PLjnbT4UISq0adw__Y9B2eXA0LL35TyORU
Websites:
---------------------
- GitHub: https://github.com/JDoucette
- Indie Game Studio: http://xona.com
- Blog: http://thefirstpixel.com