Wednesday 6 April 2016

Scripting and Dynamics - V

Last week I managed to create a fire grid and did some tests with hard coded fire sources, the result was satisfying already but there are still improvements to be made.

So for this week I decided to take a deeper look into raycasting: the idea is that the user will build the environment and then add fire simulation on top of it, so I wanted to create something that allows the user to click on environment meshes like rocks or grass and let those meshes specify the behaviour and parameters of the cells below them.

After looking extensively at the documentation I found a way to implement raycasting with Python in Maya: that is achieved through the use of the OpenMaya. 
This module provides a function called closestIntersection which performs raycasting on a specified mesh and also returns the intersection point.


By using this function I managed to implement custom parameters based on the mesh lies on top of the grid: the only missing building block to enable a fully procedural simulation is now the fire collision events so stay tuned for more progress on that!

No comments:

Post a Comment