Wired Bunny – C++, Python, RenderMan, Maya

The goal of this project was to be able to make curves on the surface of any objects. Here is a video the shows the result of the final render:

And here are some still images of the bunny:

 

  

There are three steps to achieve this model

  • First, Emitting particles and querying position of each particle for each frame
  • Second, Using RayCastNode plugin for Maya and use the particles position to draw line on the object
  • Third, using RenderMan to render the curves.

Particle Poisition

The first step was to emit particle from any source. Then I used some scripts from Fundza to generate a text file that store the position of all particles on all frames. In next video, you can see that there is a simple particle emitter that generates one set of particles, which have collision with a cube and stay in side of it

Draw line

Next step is to generate the lines. For this, using C++, part I created a RayCastNode plugin, with the help of professor Deborah Fowler and my dear friend Ali Seiffouri. What this plugin does is that it shoots a ray from given point called Origin to the second given point called Direction, then you give it an object and it’ll give you back the hit point the ray. Next image shows a screen capture of the using this plugin:

 

Then I used a Python script that uses this plugin and the text file that contains the position of each particle on each frame. Using these information, This script move the direction point based on the location of each particle and then and the query a hit point and draw a line by using those positions.

Draw line

Final step, since I was going to render the curves, I had to use RenderMan. For rendering curves I added some attributes to the curves that RenderMan requires, for doing so I followed the a guide on Fundza, this part also was taken care of by the Python script in last step. Finally I added the default Maya hair shader and set up a simple three point lighting.

Final Thoughts

Many Thanks to Professor Malcolm Kesson and Professor Deborah Fowler for their supports.

I had a hard time figuring out how to compile the C++ code in Linux, but after figured it out I made a PDF file that explains how to compile a source code for Maya plugin using Eclipse. Click here to download the guide line. Feel free to use it and please contact me if you faced any problem.

I tried to used Visual Studio and compile it for Windows but I wasn’t successful. There is a plugin wizard in the Devkit folder inside of Maya installation folder, which explains how to use the Wizard in Visual Studio to compile the source code for Maya but I couldn’t get it to work. I am planing to get that to work, then I’ll make PDF for that too.

Unfortunately most of process of this project was done in Linux and I couldn’t record my screen to show you. Hopefully I get that to work and post it in near future.