Friday 25 March 2016

Scriping and Dynamics - IV

As I mentioned in the previous post, I have been working on fire grids and I wanted to post some updates on my progress.

To start things off I created two main classes: FireGrid and GridCell; a fire grid is simply a 2D array of GridCell instances that also provides utility methods to get a specific cell from a coordinate or to get the neighbours of the provided cell.

I will be using an expression to simulate the logic and I decided to structure my code so that everything happens in steps: those are going to be calculated and executed every frame through an expression that calls some python code and that’s where most of the logic is going to lie.

In order to test things out I create a polyCube instance for each Cell and I have added some global variables to regulate both the cell size and the grid size: those will be exposed later on by the tool I will be writing to allow the user to tweak the simulation based on how big the scene is going to be.


For the next week my plan is to research and find a way to specify a material for each cell, one of the methods I have in mind to solve it would be raycasting but I would need to research this further and look at the documentation to find out if it’s possible to do so.

Friday 11 March 2016

Scripting and Dynamics - III

I started working on how to implement things for this module and since my coursework is going to be script heavy I decided to take my time and plan the features and the design of this small piece of software.
I identified three major problems to solve:
  • How to represent the grid in Maya
  • How to enable the user to edit the material of each individual cell
  • How to create an “active” item that starts spreading fire once it collides with a cell

My plan is to implement the grid first, and I will experiment with basic polyCubes for now to see if they can be also used to detect collision programmatically.

Stay tuned for updates on how this evolves!