CGTalk > Software > Autodesk 3ds max > Particle Flow
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 09-12-2008, 11:47 PM   #1
krifos
New Member
portfolio
Kristian Foshaug
3D Freelancer
Kristiansand, Norway
 
Join Date: Mar 2008
Posts: 13
Find Target -> Particles

Hi,

I'm trying to use find target to target other particles in another particle system. I've created an asteroid-system using PF, and I want to blow them up later with another particle system that will supply rockets that will use find target.

However, I'm not able to do so - and I've been googling around, and it seems like I would need some kind of script to "convert" the particle system to mesh so that they can be targeted.

Does anyone know about an easier way, or know about a script that does what I need?
 
Old 09-13-2008, 12:24 AM   #2
ADamiani
Veteran
 
ADamiani's Avatar
portfolio
Anthony Damiani
Student -- Cohort 9
Guildhall @ SMU
Plano, USA
 
Join Date: Apr 2008
Posts: 39
Right! I'm pretty sure you can't do it while the other system is still in pflow, unless you have Box #3 (or so I am told). However, pflow baker can help you mesh out your animation: http://www.scriptspot.com/3ds-max/pflow-baker

That should allow you to make them targets.

Now, this doesn't solve your whole problem, because you need them to disappear/break up when they're hit. This is going to take some scripting, and I'm not 100% sure how I'd go about it.

I suppose, in theory, if you assigned each mesh a separate U-OmniFlector, you might be able to add a script operator (after a collision test) to the missiles to hide the base object of the deflector they hit?
 
Old 09-13-2008, 03:34 AM   #3
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,321
Quote:
Originally Posted by krifos
Hi,

I'm trying to use find target to target other particles in another particle system. I've created an asteroid-system using PF, and I want to blow them up later with another particle system that will supply rockets that will use find target.

However, I'm not able to do so - and I've been googling around, and it seems like I would need some kind of script to "convert" the particle system to mesh so that they can be targeted.

Does anyone know about an easier way, or know about a script that does what I need?


This is really not necessary, because a Script Operator in PFlow can write data into the Script Vector channel of the particle system and "feed" it with targets from another particle system.

See this thread and the example I posted:
http://forums.cgsociety.org/showthr...?f=206&t=659462
__________________
Bobo

Last edited by Bobo : 09-13-2008 at 03:36 AM.
 
Old 09-13-2008, 02:54 PM   #4
krifos
New Member
portfolio
Kristian Foshaug
3D Freelancer
Kristiansand, Norway
 
Join Date: Mar 2008
Posts: 13
Thanks both, trying out the Bobo-script now, and I've made the rockets delete after finding their target.

However, the rockets doesn't seem to find their targets properly. I have five rockets that are heading towards five different asteroids, but they just pass right next to them, and they don't delete themselves (naturally since they only pass right next to them)

I've attached my scene-file (Design 2009) if anyone bothers to have a quick look.
Attached Files
File Type: zip asteroid_rocket.zip (75.8 KB, 22 views)
 
Old 09-13-2008, 03:05 PM   #5
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,321
Haven't looked at the file, but keep in mind that FindTarget is not absolute, it is just a force operator. So it drives your rocket to go in the general direction, and the test is based on a proximity threshold value - you might want to increase it to get a "hit" if you are sending out the rockets to a Delete event.

Also note that the Find Target has two useful modes - Control By Speed and Control By Time. In the Control By Time, you can define how long should it take to reach the target, and the speed will be set accordingly. I find this method to be more solid when targeting moving objects/particles. The Control By Speed is very dependent on the Speed/Acceleration Limits and might never reach the target depending on how fast it moves or changes directions.

Play with the settings and you might find the best control method for your case.
__________________
Bobo
 
Old 09-13-2008, 03:18 PM   #6
krifos
New Member
portfolio
Kristian Foshaug
3D Freelancer
Kristiansand, Norway
 
Join Date: Mar 2008
Posts: 13
Thanks for quick reply

Find Targets works accurately (or more at least) when I've made random asteroids myself (as mesh) and scattered about. It just doesn't work properly now using this script operator to target the particles.

See the attached screenshot, orange is emitter, green is asteroids (particles), blue is rockets and red is their trails. As you can see, they head in roughishly the correct direction, but they miss by quite a lot. (the distance between emitter and particles is greater than it looks btw)

Since they don't do when I've manually placed the asteroids there (without PF), there has to be some tweaking to do with the script I'm thinking? If I could have them target the centre of the objects somehow (as they do outside PF).

Sorry if I explained myself poorly
Attached Images
File Type: jpg asteroid7.jpg (73.3 KB, 30 views)
 
Old 09-13-2008, 03:27 PM   #7
JonathanFreisler
Lord of the posts
 
JonathanFreisler's Avatar
portfolio
Jonathan Freisler
FX Magician
Iloura
Melbourne, Australia
 
Join Date: Sep 2005
Posts: 730
Send a message via MSN to JonathanFreisler
i downloaded the attachment, but there doesn't seem to be anything in it? could just be me (why am i still using Google chrome, lol)

If the asteroids are moving, it could be finding them at there initial state? and not calculating there movement? Not sure without checking the file out.
__________________
www.jonathanfreisler.com
 
Old 09-13-2008, 03:30 PM   #8
krifos
New Member
portfolio
Kristian Foshaug
3D Freelancer
Kristiansand, Norway
 
Join Date: Mar 2008
Posts: 13
Should be working, I just downloaded the zip and opened the max-file. Try downloading with FF or IE or Opera

I've disabled the spin-operator so the asteroids are not moving and not rotating, but it still happens.

Last edited by krifos : 09-13-2008 at 03:33 PM.
 
Old 09-13-2008, 04:06 PM   #9
JonathanFreisler
Lord of the posts
 
JonathanFreisler's Avatar
portfolio
Jonathan Freisler
FX Magician
Iloura
Melbourne, Australia
 
Join Date: Sep 2005
Posts: 730
Send a message via MSN to JonathanFreisler
IE worked fine lol. Thanks google. If you turn follow target animation off they hit the target 100%... but that doesn't help you terribly.
__________________
www.jonathanfreisler.com
 
Old 09-13-2008, 04:18 PM   #10
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,321
Quote:
Originally Posted by krifos
Thanks for quick reply

Find Targets works accurately (or more at least) when I've made random asteroids myself (as mesh) and scattered about. It just doesn't work properly now using this script operator to target the particles.

See the attached screenshot, orange is emitter, green is asteroids (particles), blue is rockets and red is their trails. As you can see, they head in roughishly the correct direction, but they miss by quite a lot. (the distance between emitter and particles is greater than it looks btw)

Since they don't do when I've manually placed the asteroids there (without PF), there has to be some tweaking to do with the script I'm thinking? If I could have them target the centre of the objects somehow (as they do outside PF).

Sorry if I explained myself poorly


Bummer. Don't have 2009 installed at home.
So let's try to solve this without looking at the file, otherwise I have to drive to the office on a Saturday

Chances are the data in the Script Vector Channel is off for some reason.
First of all, I assume the asteroid particles are moving. Second, I assume the Script Operator is running on each frame, constantly updating the positions of the moving asteroids to the rockets' Find Target. Does this sound right?
Now, you have the asteroids as meshes. Can you confirm that the Asteroid Meshes' Pivot Points are centered correctly? Does it look the same when using a simple Shape Operator or Display set to Tick? Just trying to exclude the case where the Shape's Mesh has a Pivot outside of the geometry and the particle appears offset in PFlow, while being somewhere else completely. (I know you are smarter than that. but just checking).

Also, is the Find Target set to Icon or Mesh Objects? If it is set to Mesh Objects and something is picked in the list, all Script Vector positions are interpreted as local coordinates relatively to the mesh instead of world coordinates, which could introduce quite an offset...
__________________
Bobo

Last edited by Bobo : 09-13-2008 at 04:21 PM.
 
Old 09-13-2008, 04:34 PM   #11
JonathanFreisler
Lord of the posts
 
JonathanFreisler's Avatar
portfolio
Jonathan Freisler
FX Magician
Iloura
Melbourne, Australia
 
Join Date: Sep 2005
Posts: 730
Send a message via MSN to JonathanFreisler
ok, well i managed to get the particles to find there target, and then to go to there next event,

for some reason disabling 'follow target animation' worked with countering the offset. But that doesn't help if your asteroids will be drifting.

hehe bobo, that was the first thing i checked, the pivot :P The asteroids are not moving at all, and there just idle doing nothing. But the offset with 'follow target animation' on sends them directly up on Z all in equal units if that makes sense.
Attached Files
File Type: zip asteroid_rocket01.zip (73.7 KB, 16 views)
__________________
www.jonathanfreisler.com
 
Old 09-13-2008, 04:44 PM   #12
krifos
New Member
portfolio
Kristian Foshaug
3D Freelancer
Kristiansand, Norway
 
Join Date: Mar 2008
Posts: 13
Quote:
Originally Posted by JonathanFreisler
IE worked fine lol. Thanks google. If you turn follow target animation off they hit the target 100%... but that doesn't help you terribly.


I noticed that too now. However, if I want (and I do) the asteroids to move, it needs to be checked.


Quote:
Originally Posted by Bobo
Bummer. Don't have 2009 installed at home.
So let's try to solve this without looking at the file, otherwise I have to drive to the office on a Saturday


Lets pick the first option

Quote:
Chances are the data in the Script Vector Channel is off for some reason.
First of all, I assume the asteroid particles are moving.


I've tried both with moving and non-moving asteroids.

In the screenshot they are 100% still, and then it works by unchecking "follow animation", as JonathanFreisler mentioned. However, whenever "follow animation" is checked, it is somehow "offset" by a certain amount. I tried again to animate the asteroids, and the rockets still miss by the same amount - and if I play long enough, they turn around and chase past the asteroids in an endless loop (even after asteroids has stopped).

Quote:
Second, I assume the Script Operator is running on each frame, constantly updating the positions of the moving asteroids to the rockets' Find Target. Does this sound right?


I guess, I'm no into scripting so I just copied the script which was in your example file, and replaced the events.

Quote:
Now, you have the asteroids as meshes. Can you confirm that the Asteroid Meshes' Pivot Points are centered correctly? Does it look the same when using a simple Shape Operator or Display set to Tick? Just trying to exclude the case where the Shape's Mesh has a Pivot outside of the geometry and the particle appears offset in PFlow, while being somewhere else completely. (I know you are smarter than that. but just checking).

I'm smarter than that (I think) But I checked again just to be sure, and changed display to ticks and boxes, and the rockets are still off. Pivot point should be centered to the mesh.


Quote:

Also, is the Find Target set to Icon or Mesh Objects? If it is set to Mesh Objects and something is picked in the list, all Script Vector positions are interpreted as local coordinates relatively to the mesh instead of world coordinates, which could introduce quite an offset...



Yeah, it's set to icon. I tried to select Mesh Object, but then it only selected the original asteroid-mesh.
 
Old 09-13-2008, 04:53 PM   #13
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,321
You are specifying the targets using a Script Operator via the Script Vector Channel.
Follow Target Animation MAKES NO SENSE if you don't target moving icons/meshes. If your Find Target does not specify meshes as targets, the target animation is provided by the Script Operator. On each frame the Script Vector Channel is updated with the current positions of the asteroids, and the Find Target has to target that.
__________________
Bobo
 
Old 09-13-2008, 05:03 PM   #14
krifos
New Member
portfolio
Kristian Foshaug
3D Freelancer
Kristiansand, Norway
 
Join Date: Mar 2008
Posts: 13
My asteroids are made up from a particle system. The asteroids are scattered within the volume of an object (in this case a box, but could also be a torus if I wanted to make an asteroid-belt).

To animate the asteroids, I'm using spin-operator (which shouldn't matter since they keep their pivot-points at the same spot), and then I'm animating the box up and down.

When I'm not using "follow target animation", the rockets go in the straight path as they do when the asteroids are not animated, and thus misses the animated asteroids.

When it's checked, they do follow them, but with the Z-axis offset as JonathanFreisler mentioned.

So if I understand you correctly, I'm not supposed to use the follow target animation at all? But how would they follow it then? Nothing seems to happen if it's not checked.
 
Old 09-13-2008, 05:10 PM   #15
JonathanFreisler
Lord of the posts
 
JonathanFreisler's Avatar
portfolio
Jonathan Freisler
FX Magician
Iloura
Melbourne, Australia
 
Join Date: Sep 2005
Posts: 730
Send a message via MSN to JonathanFreisler
wait your animating the box up and down? the file i got didn't have keys on the box, problem might lie there. Id recommend not animating the box, and putting speed on them anyway.

bed time, its 3am.
__________________
www.jonathanfreisler.com

Last edited by JonathanFreisler : 09-13-2008 at 05:19 PM.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:19 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.