PDA

View Full Version : Node math?: making 'n' conform to range 0<>1?

jeric_synergy
09-11-2013, 03:42 PM
What is the proper nodes/network to use to reduce an UNKNOWN number of items from an output, to a range between 0 and 1?

RebelHill
09-11-2013, 03:54 PM
When remapping like this you have to have a scale... if the number of items is unknown (esp if prone to change) then it may as well be a random number output. You can easily start 0 at 0, but at what SCALE of output do you want 1?

Unless you mean have it output 1 when theres something, and 0 when theres nothing... in which case divide the output by itself, any number x/x=1 except 0 which =0.

jeric_synergy
09-11-2013, 05:26 PM
I guess what would be required would be a node that has a "Total # of Parts" output.

For most (of my) scenes this would be a static integer, but for scenes with particle generators and such this would vary. STILL, for a given, non-generated Object and/or Layer, this would usually be static (no?)

This would allow construction of node networks that automatically ranged for the number of Parts in any Object, so the network could be saved and applied to a wide variety of Object.

TMK there is currently no way to find out the number of Parts in an Object/Layer or Scene. Wouldn't that be nice to know?

(It's always amusing/maddening the number of odd things that are difficult or impossible to determine easily, when after all, there's a computer Right In Front of Us.)

Sensei
09-11-2013, 05:50 PM
LW doesn't store that info.
To know how many parts is in mesh, there is needed to scan the all polygons and build database by hand.

probiner
09-11-2013, 06:12 PM
db&w Tools (http://www.db-w.com/products/dbwtools/docs) Sequencer Node.

Cheers

jeric_synergy
09-11-2013, 06:12 PM
LW doesn't store that info.
To know how many parts is in mesh, there is needed to scan the all polygons and build database by hand.
Ok.... so how do plugins know the Parts index #?

db&w Tools (http://www.db-w.com/products/dbwtools/docs) Sequencer Node.

Cheers

Huh??? Wuzzzatt?? In words of one syllable or less, please.

Sensei
09-11-2013, 06:16 PM
Ok.... so how do plugins know the Parts index #?

Disconnected group of polygons is not the same as part index, in sense that part is created by "Create Part" tool.
Anyway, it's all scanning the whole geometry and building database, checking which polygon is attached to which polygon by edge.. Time consuming and expensive task. The more geometry, the longer setting up time.

jeric_synergy
09-11-2013, 06:45 PM
Soooooo, is the PARTS INDEX maintained by DPKit PartMove compiled by the node, or by LW???

dpont
09-12-2013, 12:07 AM
Soooooo, is the PARTS INDEX maintained by DPKit PartMove compiled by the node, or by LW???

Currently each dynamic or procedural system
hast its own initialization and preprocess for geometry,
Part Index of Part Move (and shared by Part Info)
is assigned the same way than in dynamic HardFX, Bullet..
in Displacement context, there's an option for showing
the index in OpenGL Preview.

In DP Motion Designer, you can bake a Part Move animation
in a BDD file (Rigid Body Dynamic) with BDD Scan,
it can be played/edited by HardFX.

Denis.

jeric_synergy
09-12-2013, 01:32 AM
Currently each dynamic or procedural system
hast its own initialization and preprocess for geometry,
Part Index of Part Move (and shared by Part Info) .....
Thank you Denis. If I'm understanding you correctly, each system maintains its own Parts count.

One question: if Part Move and Part Info are tapping into the same resources to generate the Index output, why are the two Index outputs of those respective nodes not interchangeable? The Part Move index output works for coloring Surfaces by Part Index, but Part Info index output does not. I do not understand why.

Since for my purposes, whatever overhead is involved in counting the parts is instantaneous, I'm not going to worry about that.

Once a given system has counted the Parts, either globally (parts in the Scene) or locally (parts in the Object/Layer), would it be possible to get a "Total # of Parts" output for those non-generated (i.e., particles, with their ever-changing # of parts) entities, i.e. normal, static objects?

Thanks!

dpont
09-12-2013, 01:48 AM
...One question: if Part Move and Part Info are tapping into the same resources to generate the Index output, why are the two Index outputs of those respective nodes not interchangeable? The Part Move index output works for coloring Surfaces by Part Index, but Part Info index output does not. I do not understand why.

Only Part Move node does the job,
Part Info node get this information through its connection to Part Move,
so Part Info is not really interesting by itself for just colouring
with part index,
again you just need Part Info in Displacement for varying
the animated channels of the part.

I added a "Total", "oPos" and "wPos" outputs in Part Move node, for total
number of part in the current mesh, position of the current part in local and
world coordinates, the world position includes the individual transformation
of the part, these positions could be used in the Replace Spot node (DP Filter)
The number of parts is also displayed in the node panel.
"Shift" input has been renamed "Pivot Offset" since there was
some confusion in its usage.

Denis.

jeric_synergy
09-12-2013, 08:43 AM
Only Part Move node does the job,
Part Info node get this information through its connection to Part Move, {snip}
Thank you Denis.

So, since PartInfo doesn't have any inputs, does information flow "backwards" into it from a connection to PartMove? (I assume PartMove doesn't have to be the very next node.) Or is the information implicit in the environment the node is deployed in (eg the Displacement panel), or what? (RebelHill, if you're reading this, here's my confusion about info-flow again.)

I added a "Total", "oPos" and "wPos" outputs in Part Move node, for total
number of part in the current mesh, position of the current part in local and
world coordinates, the world position includes the individual transformation
of the part, these positions could be used in the Replace Spot node (DP Filter)
The number of parts is also displayed in the node panel.
"Shift" input has been renamed "Pivot Offset" since there was
some confusion in its usage.
Denis.
Goodness gracious, THANK YOU Denis! I see DPKit has been updated today. :thumbsup:

(just to confirm): So, I should be able to use this TOTAL output to scale ranges for ANY Object, so that I can normalize counts to be equally distributed between 0.0 and 1.0, correct?

dpont
09-12-2013, 09:03 AM
...So, since PartInfo doesn't have any inputs, does information flow "backwards" into it from a connection to PartMove? (I assume PartMove doesn't have to be the very next node.) Or is the information implicit in the environment the node is deployed in (eg the Displacement panel), or what? (RebelHill, if you're reading this, here's my confusion about info-flow again.)

Part Info doesn't have to be the previous node of Part Move,
must in a nodal chain before Part Move,

In all node editors,
nodal data of user connections goes foreward,
Internal nodal data informations goes backward.

..(just to confirm): So, I should be able to use this TOTAL output to scale ranges for ANY Object, so that I can normalize counts to be equally distributed between 0.0 and 1.0, correct?

Part index divided by number of parts (-1), gives a value ranged between 0 and 1.

Denis.

DogBoy
09-12-2013, 09:08 AM
db&w Tools Sequencer Node.

Huh??? Wuzzzatt?? In words of one syllable or less, please.

it. duz. wot. u. want. ;)

in more than one syllable: take your output. Plug it into input. the green output Sequence does what you asked for. pretty much.

jeric_synergy
09-12-2013, 09:43 AM
Sorcery!