This content originally appeared on Level Up Coding - Medium and was authored by Kaveh Kardan
I still have the MCL code I wrote during the years of Metropolis Graphics. I found a comment dated 4 April 1992 in the matrix math file. Thirty years almost to the day from the writing of my new system (which I have called kons-9 in the Github repository for reasons which are not entirely clear to me).
Metropolis Graphics counts as Lisp Graphics System 3 (LGS-3), following as it did the Symbolics and AKCL systems. I have the source because it was one of the few things in my Dropbox folder when the house fire happened. All my other backups were in a neatly stacked pile of CDs next to my computer.
I have seen comments dated from 1992 to 1994 in the code, so I worked at least that long on the project.
When I develop in Common Lisp, I feel like I have somehow come up short if I have to write all the code myself. The computer should write some of the code for me. That’s what macros are for.
In this case, I wanted the UI for the graphics classes to be automatically generated. MCL had excellent support for the Mac Toolbox (being a first-party Apple product), and I wrote macros which simultaneously defined a class and generated UI panels for the class.
I also remember working on implementing my idea of smart objects. 3D entities with internal workings which understood commands such as “move forward” and would move (e.g. by walking, rolling, jumping, etc.) based on their internal mechanics. Much what I imagined obviously came to pass, in the form of 3D rigging in DCC apps, and behaviors in game authoring systems. Time waits for no one.
While Mike worked on his renderer, I implemented RenderMan RIB (RenderMan Interface Bytestream) output and rendered some short animation clips on Taarna’s high-end desktop Mac using Pixar’s MacRenderMan package. It was a painfully slow process as I recall.
You would think that I would have carefully studied the Metropolis MCL code prior to embarking on my current project, but that's not the case. I have only looked at and used a few files (3D points, matrices, and superquadrics so far), and preferred to design from scratch. Why? I’m not sure. Decades later, there are still emotions attached to the software.
Maybe I will look more at the code at some point in the future. I’ve even idly thought of digging up an old PowerBook and an MCL diskette and seeing if the code can still be run. Though to be honest I most likely will let that remain an idle thought.
Design & Code
I had a thought to make a particle system which would climb a shape like vines up a tree. Or a teapot, as seen above.
This was done in two parts.
One was a subclass of particle I called climbing-particle which does what a normal particle does and then snaps to the nearest point on a point-cloud. It is gratifying to be able to express new behavior with so few lines of code. Somehow gives me the feeling that I'm doing something right. Or maybe this is all essentially trivial and I'm just fooling myself.
The second part was implementing the generate-point-cloud method, which fills the surface of a polyhedron with points at a specified density. This was done using barycentric coordinates on triangulated polygons. The same technique I used back in the day for growing hair and fur on CG models. Everything old is new again.
32. My Object Is Smarter Than Your Object was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Level Up Coding - Medium and was authored by Kaveh Kardan
Kaveh Kardan | Sciencx (2022-06-18T18:55:42+00:00) 32. My Object Is Smarter Than Your Object. Retrieved from https://www.scien.cx/2022/06/18/32-my-object-is-smarter-than-your-object/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.