Jump to content

Reading The Velocity Of The Particles.


Symbolic

Recommended Posts

I have a POP network with a simple particle system. I want to read each particle's velocity. After that, I want to use this data as a modifier for the playback speed of each *.bgeo sequance copied over each point with the COPY sop. I have stamping on the COPY SOP.

I can modify the speed of the BGEO PLAYBACK with sliders. I am able to plug $ID to stamp up the network. When the $ID is used; the copy that is on point 1 will move at speed of 1x and the copy that is on point 20 will move at speed of 20x. So I am able use the attributes of the particles.

Why things like $VX, $VY, $VZ are not working?

thanks.

Link to comment
Share on other sites

Here are some tests showing the particles and the copied geometry.

Not the best models. But this is just a test.

Bug On The Wall

Particles On The Wall

The HIP file.

Legs BGEO

Wings BGEO

Please have a look. First I will try fixing the VELOCITY playback issue. Then I will have to make the geometries avoiding going through each other.

Thanks for all kind of helps!

Link to comment
Share on other sites

Ow!... Sorry.

I have been working on the file for a while. I have fixed some of the errors. I got the running figures. But it is too late now... I have to sleep for a while... I am really sorry if I am posting the same things again and again... it is just the panic...

I will study the file. It seems to be a great help. I did not understand most of the things. I am sure I will understand what is going on in a short time. But meanwhile... I am researching for the alternative solutions just in case that I am not able to understand the file.

Questions:

Where they switch to the skeletons?

Is there a speed calculation?

There are a few different cycles like RUNNING, WALKING, JOGGING... are they switched depending on the particle speed?

The calculation seems to be very slow... will it work with 40-50 flies?

Thanks for your time... and for your help...

Link to comment
Share on other sites

Where they switch to the skeletons?

Walk cycles are exported to disk as seqences of geo files, that way they can be easily mixed

with blendSOP

Is there a speed calculation?

lenght of the v[3] vector (attribute of particles) is nothing more then so called "speed".

You can compute it in expression (vlength) or in VEX and use it for driving your geo.

There are a few different cycles like RUNNING, WALKING, JOGGING... are they switched depending on the particle speed?

see above.. blending not switching would be more applicable but just try ...

The calculation seems to be very slow... will it work with 40-50 flies?

Bellow symulation with 2000 agents. Only particles were pre-calculated... ;)

houdinicrowd2000agenteshl1.th.jpg

Edited by SYmek
Link to comment
Share on other sites

I just loaded up the hip file & thought to make it easier for others who would like to get it up & running quickly.

You can copy and paste the following into the textport (Alt-Shift-t or Windows menu > Textport) to update the path of the File SOPs so you don't have to edit by hand:

opchange \$HIPDIR\/models \$HIP
opchange -i \$HIP\/skeleton\/SK \$HIP\/sk

You should get this:

/ -> opchange \$HIPDIR\/models \$HIP
Changing $HIPDIR/models to $HIP
	/obj/Crowd/prim_man_run
	/obj/Crowd/prim_man_jog
	/obj/Crowd/prim_man_slow_walk
	/obj/Crowd/prim_man_stand
	/obj/Crowd/skeleton_run
	/obj/Crowd/skeleton_jog
	/obj/Crowd/skeleton_sow_walk
	/obj/Crowd/skeleton_stand
Changed 8 references

/ -> opchange -i \$HIP\/skeleton\/SK \$HIP\/sk
Changing $HIP/skeleton/SK to $HIP/sk
	/obj/Crowd/skeleton_run
	/obj/Crowd/skeleton_jog
	/obj/Crowd/skeleton_sow_walk
	/obj/Crowd/skeleton_stand
Changed 4 references

It's important to run the commands in sequence else the second command might not work correctly.

Hope the above helps!

Cheers!

steven

Link to comment
Share on other sites

Hey! It's my old skeleton demo file... sweet :). I thought this one had been lost in the mists of time. Or maybe I'd just blocked it from memory..

eh, either way.. sweet! :)

Cool :)

I am working on the file. Will post results and tests here. Either things related to the techniques used in the files... or other stuff.

Link to comment
Share on other sites

Ok. I have figured out a way to read the speed of the particles and direct that into a *.bgeo playback system.

//

After the POP NET I used an attributeCreate SOP:

name: speed_read

Value: int(fit(abs(($VX+$VY)/2),0.8,0.1,5,1)

Since the VELOCITY is a vector... (I am nothing in maths. but this is what I knew from high school)

It means that a velocity of -4 is as big as +4... just the direction is different. So it still has to generate a positive value and set the speed of the *.bgeo play back to 4... so ABS gives an absolute value. It is the sum of the X and Y velocities. (my particles move only on X, Y)

FIT brings the value from the range of 0.8 and 0.1 to the range of 5 and 1. The normal playback speed of the BGEO expression is 1... and 5 is fast enough.

In the POP networks... I have a LIMIT POP to make the particles move with a minimum speed of 0.1 and max speed of 0.8.

INT is used to generate whole numbers... like 2, 3, 1 etc.

//

In the COPY sop I have the stamping enabled:

speed -> $SPEED_READ

this pumps a variable called "speed" up the network.

//

in the FILE sop that goes into the COPY sop I have a spare parameter:

frame_CTRL: ((($Fstamp("../copy1", "speed", 1)))%45)+1

This creates a number based on the frame and the speed. %45 is because I have 45 bgeo files. +1 is to avoid getting 0

//

This "frame_CTRL" thing is pied into the FILE sop "file name" area:

$HIP/legs/legs_'chs("/obj/sys/file2/frame_CTRL")'.bgeo

when chs("/obj/sys/file2/frame_CTRL") is 20

it is the file legs_20.bgeo that is called.

Primitive but works for now. I will try to improve it.

Any ideas.

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...