PDA

View Full Version : Adjusting Sprite Positions. Possible?


Venator11387
08-24-2011, 08:39 PM
I would like to know if it is possible for sprite positions to be offset?

Right now I am having particles collide with a plane with a collision event producing a sprite showing an image sequence on the ground. Problem is that only the upper half of the sprite will show. I want to find a way to have the entire sprite show up above the plane.

stooch
08-24-2011, 11:39 PM
increase collision offset.

Venator11387
08-25-2011, 12:09 AM
You mean Offset in the geo connector? I tried that before. There is no effect occurring. Your solution was also brought up in this earlier thread. Perhaps I am choosing the wrong offset.

http://forums.cgsociety.org/archive/index.php/t-626645.html

stooch
08-25-2011, 12:46 AM
are you using nparticles? try adjusting the radius in the particle size attributes of the particleShape if you are.

Also, make sure that you are making colliders using the nMesh menu in the nDynamics mode if you are using nparticles and if you arent using nParticles, make sure that you are using the "make collide" tool from the dynamics mode.

Venator11387
08-25-2011, 01:22 AM
I am not using nParticles. I am just using regular Dynamic particles. I also tried "make collide" and it is not working. I've even put the offset as high as 1000 with no effect.

Aikiman
08-25-2011, 01:46 AM
May be overkill but you could use the emit command to emit new particles at the position of collisions with an offset in Y.

The collision offset on the geoConnector doesnt seem to work as you would expect.

Venator11387
08-25-2011, 02:01 AM
Does the offset usually work for this kind of problem in your experience?

Aikiman
08-25-2011, 02:04 AM
I would use nParticles for more control.

Heres the code for my original idea...



if(particleShape1.collisionU>0)
particleShape1.lifespanPP=0;

vector $pos = particleShape1.position;

if(particleShape1.lifespanPP==0) {
emit -object particle2
-position ($pos.x) ($pos.y+(particleShape2.spriteScaleYPP*0.5)($pos.z);
}


Forgot to mention, add spriteScaleXPP and YPP on particleShape2 with a value in creation.

hkspowers
08-25-2011, 02:10 AM
You could duplicate your surface and manually offset it then collide your particles with that surface and then hide the surface, so it looks like it's hitting your original surface. I think the reason the offset doesn't work perfectly is the way Maya does it's collision calculations, it seems to detect collision at a frame but doesn't affect anything until the next frame, so you will still get slight penetration even with very high offset.

Venator11387
08-25-2011, 02:29 AM
Thanks Hk, but I was actually using that method in the first place. It's just I do not like using it as the sprite effect and other collision effects do not line up well at all, especially when I want to add markers of where they collide (ex. scorch marks caused by bullets).

I just wanted to know if there were some clever industry tricks out there that didn't need the use of this.

hkspowers
08-25-2011, 03:09 AM
Ahh yeah if that's not working I would go the scripting route as Aikiman has posted.

stooch
08-25-2011, 06:17 AM
there is nothing wrong with nparticle collisions. you dont need to do any scripting. if you follow what i said in this thread it will work just fine. for nParticles you need to adjust the thickness parameter on the passive collider object, you may have to crank up the thickness if your items are huge in world space... here is an example scene.

Venator11387
08-25-2011, 06:35 AM
Thanks a lot Stooch, I'll give it a try!

hkspowers
08-25-2011, 06:35 AM
there is nothing wrong with nparticle collisions. you dont need to do any scripting. if you follow what i said in this thread it will work just fine. for nParticles you need to adjust the thickness parameter on the passive collider object, you may have to crank up the thickness if your items are huge in world space... here is an example scene.

I was going on the basis that he was not using nParticles.

Aikiman
08-25-2011, 12:21 PM
there is nothing wrong with nparticle collisions. you dont need to do any scripting. if you follow what i said in this thread it will work just fine. for nParticles you need to adjust the thickness parameter on the passive collider object, you may have to crank up the thickness if your items are huge in world space... here is an example scene.

Theres nothing wrong with nParticles but he did say he wasnt using nParticles so if he was stuck with old particles then there probably is a need for code.

BTW my version of maya 2011 doesnt like your file isnt that just great!

stooch
08-25-2011, 10:02 PM
Theres nothing wrong with nParticles but he did say he wasnt using nParticles so if he was stuck with old particles then there probably is a need for code.

BTW my version of maya 2011 doesnt like your file isnt that just great!

enable "ignore file version" in your file - open - options. I am using 2012.

Well he has a good reason to use nParticles then ;)

Aikiman
08-26-2011, 12:55 AM
enable "ignore file version" in your file - open - options. I am using 2012.

Well he has a good reason to use nParticles then ;)

Yeah I figured you were which is why I did but still crashing, nvm.

CGTalk Moderation
08-26-2011, 12:55 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.