Monday, October 29, 2012

nParticle Instance Geometry and random rotation

Instance different geometry to random particles and give particles random rotation and rotation speed.

nparticles are a pain, here is a fairly simple way to get the nparticles to grab random geometry from the instancer, all you need is an instancer that contains your geometry that's connected to your nParticles. next you'll want to "create a dynamic attribute" in the nparicle shape node, you'll need 4 new attributes:
* all are per particle because we want each particle to be different.
1) randomPeicePP - FLOAT and will be the random geometry from the insatncer
2) randInit - this is a VECTOR and will contain the random starting rotation of the instanced geo
3) rotateSpeed - FLOAT this will be the ransom speed of the rotation
4) rotationFinal -FLOAT this is where our final particle rotation values are sent to for the nparticle to look at and apply to particles

go to the expression editor for your nparticleshape node and create the following expressions.

//creation//
nParticleShape1.randomPeicePP = rand(0,7);
this is generating a random number between 0 and 7, go one higher than the number in the instancer.
nParticleShape1.randInit = <<rand(-180,180), rand(-180,180), rand(-180,180)>>;
this gives a random vector rotation (X,Y,Z)
nParticleShape1.rotateSpeed = rand(-1,1);
 this is the speed of rotation, it will be spinning between 100% forward and 100% backwards
 
//runtime//
vector $rotInit = nParticleShape1.randInit;
this just stores the random start rotation in a variable for reference  below
float $spin = $rotInit.z + (frame * 80.0 * nParticleShape1.rotateSpeed);
this creates the final rotation variable, it takes the random start rotation of the particle and adds rotation to it based off time and speed, "80" is just multiplying the grand total because it was too slow, if you wanted to you could change "rotate speed to "rand(80,-80) " and get rid of this but this allows me to easily change the max speed in one number.
nParticleShape1.rotationFinal = <<$rotInit.x, $rotInit.y, $spin>>;
this just assigns the final rotation to an axis of the particles, this is what is assigned to the particles come runtime. only the Z axis is used because if you assign rotations to more then one axis you get weird rotations, like a Frisbee or axe being through thing normally only rotate around one axis.
 
the final step is going to the instance options and in "object index" and find your "randomPeicePP" attribute you created and in the rotation section set it to your "rotationFinal" attribute.

Tuesday, October 16, 2012

3d modeling reference

I made this quick reference/cheat sheet for modeling, especially organic modeling like faces or hands or feet.

The top steps are for simplifying, for example the hand is pretty dense in edge loops but when it comes up to the arm you don't need that much topology so you need to simplify and this is what I use to do that.
the middle is simply two different flows being mixed, I kept having trouble getting that right and once I drew this out I found it much easier to model. the last is for re routing a line and adding more topology while avoiding triangles and 5 sided faces.

I've found triangles don't matter much on geometry that doesn't deform but on deforming surfaces triangles seem to deform oddly so sticking to 4 sided polygons is the way to go.

Friday, October 12, 2012

3d Interior Renders

finally getting around to updating my blog. I've been pretty busy at work and on personal projects but I have managed to get out a couple renders over the past couple months. here are my two latest ones.

my soldier is famous!

My 3d model was used to promote my school. this ad was shown in theaters and on tv.


IOS Apps

started making IOS apps


this is a test app we made for Discovery channel, I coded it in unity using Javascript and we used String for the 3d tracking.