I know, I know… I haven’t updated my blog worth a shit lately, but I really have been busy.. Really :)
Anyway I figured I would jump on at lunch today and update anyone who is actually following along here and has been anxiously awaiting an update. Well I finished the Mech project, well at least what was in the videos and started on all my fancy-shmancy stuff that I am adding. This time around I am focusing on MEL, and let me tell you that it has been some ride, and MEL has made me love Maya even more. Well you have probably read how I added the turret to my mech and even added a section to my UI that allowed me to automate the creating of a laser beam on any given frame, well I didn’t stop there, I decided to automate the whole thing and have been diligently exploring Maya to find ways to make it possible.
So lastnight and today I tackled what I though was going to be the hardest part of the logic and that is how to tell where the laser intersects with the ground, wherever that may be. Well at first I thought I would have to create a whole particle system to accomplish it, and I could have, but I really wanted to stay as close to what I was taught so as to save time, that was the hard part, but easier in the end :)
So what I finally decided on was to create a single particle, and make the ground a collision object. Again I thought it was going to be harder than it was in that I was looking on how to return the UV cords where the particle collided with the ground so that I could convert it into world space and then add the effect to that location. Well it turns out that Maya has this nifty little Collision event that will run a procedure whenever a collision happens. So it was as easy as writing code in the procedure to create a locator, point constrain it to the particle, delete the point constraint, and walla, I have the location. Here is the code I used to prove that it all could work.
global proc test(string $particleObject, int $particleId, string $geometryObject) {
//$ptclLoc = (`xform -ws -q -t particle1`);
$loc = (`spaceLocator`);
$pntCon = (`pointConstraint -w 1 particle1 $loc`);
delete $pntCon;
delete particle1;
}
So tonight will be spent working on a way to automate the projection of a nurbs square onto the ground, and biraling it into geometry to create the blast opacity, that will simulate the laser impacting the snow. Damn I am loving this.
No comments:
Post a Comment