PDA

View Full Version : Is this possible with DPont's part/poly move node?



adk
01-10-2010, 10:16 PM
Greetings node gurus :thumbsup:

I got a bit of a dilemma of whether or not I should do this the long way - a painstaking move on about 400+ buildings one by one to a correct height, or if I should even attempt to do this some other way.

Basically I have all these buildings that were constructed externally, to their correct respective footprints but for some reason they are all over the place in terms of their respective heights.

I managed to obtain some aerial survey data (ladar scan of non ground as well as ground points ) which I brought into LW & triangulated, & from that one can pluck out quite easily a point/poly on the roof's surface of the buildings in question & then raise their respective externally constructed counterpart to the correct height. Ok for 1-50 of those, but I'm a slacker & want to automate as much of this as possible.

I can kind of get close to achieving this by using KO-Pointfit & the zoom-polygon option but that also involves a bit more manual labour that I'm willing to sacrifice at this stage so I'm here seeing if anyone has done something similar or if this is even remotely possible with DPont's part/poly move node.

One thing I can think of is that one can rig a surface node to shoot a ray and evaluate the distance between two surfaces .... refer to 1st pic below, and I'm wondering if that discrete distance could somehow be translated and plugged into a part/poly move node in order to accomplish something like the animated gif below?

Any help / ideas would be greatly appreciated. In the meantime I'll continue to tinker away. Cheers a bunch :thumbsup:

serge
01-11-2010, 11:37 AM
Not nodal, but what will (should) work is the following: place your buildings object above the ground object. Apply HardFX, give it some Y-gravity, and check "StopByEvent". Add 'collision' to the ground object (set mode to "Event"). The parts (buildings) should stop on collision with the ground.

I fiddled around with 'Part Move' but couldn't find a working nodal setup for this situation. What you want more or less is this (I think): the Y-position of the part (building) should be equal to the Y-position of the spot/point/poly(?) of the ground object at the X/Z coordinates of the part. Perhaps somebody can still come up with a nodal solution for this, I'd be very interested.

adk
01-11-2010, 02:56 PM
Cheers serge :thumbsup:
I'll give HardFX a go and report back on progress.

I twiddled a bit with part_move as well but could not get to what I was after.

adk
01-11-2010, 05:04 PM
... unfortunately HardFX doesn't quite cut the mustard in this case as the moved polys don't quite stick perfectly to the background collision ones (see pic). Not in a consistent way that I could figure out anyway which is a pain.
It's most likely to do with their respective size & I can't for the life of me figure out how to control for that.

Damn shame cause apart from that it seems to work fairly well.

serge
01-11-2010, 07:57 PM
Bummer. Yeah, HardFX isn't exactly 100% reliable.

Something else that should work better. Are you familiar with Hardlink? You could grab the polys from the floors from the buildings, morph them to the position of the ground object for example by using Background Conform, and then Hardlink the buildings to these polys.

If you don't know what the heck I'm talking about I'll give a step by step explanation tomorrow, as I need to get some sleep now :).

adk
01-11-2010, 08:02 PM
I'll give it a shot serge :)
I got a general gist of what's happening there so I should be right figuring it out. If not I'll give you a holler :thumbsup: thanks a lot for your help & suggestions.

Just wish I could understand nodes a bit better so I could at least know if it's possible/doable or not.

serge
01-13-2010, 09:30 AM
I found a nodal way after all. The parts will be moved with Dpont's Part Move based on the Y-value of the nearest ground point (with Dpont's "Nearest Point" node).
I thought of this before, but dismissed the idea because it would only work well on a near flat ground. The reason is that the nearest ground point to a part could very well be on a hill next to the part instead of a point straight down. But, since you've come very close with HardFX this should work. You save the transformed buildings object after the HardFX simulation, and then reload it with this nodal setup (see attachment).


Setup explanation:

> The 'Distance' node measures the Y-distance between the part (Part Info) and its nearest point (Dpont's Nearest Point node).

> The 'Vector Scalar' nodes and 'Make Vector' nodes in between are necessary to extract the Y-value of the coordinates. The Vector Scalar 'Mode' needs to be set to "Y channel". (If the Part Info and Nearest Point nodes would have had a Y-output they could be directly plugged into the Distance node.)

> The measured Y-distance is turned into a vector (Make Vector node) to move the parts (Part Move node).

> It's very well possible that after the HardFX simulation some parts are above and some below the ground plane. Since the measured Y-distance is a positive value, the above setup only works for parts that are lower than the groundplane since they need to be moved up. The parts that are above the ground need to be moved in negative Y-direction, and for that I used the 'Logic' and 'Multiply' nodes. The Logic node says: "A is greater than B, if True: -1.0, if False: 1.0. If you multiply this with the measured Y-distance the parts higher than the ground will be moved in negative Y-direction.


Hope this makes sense. It's really fun to experiment with nodes (that is if you don't have a close deadline).

adk
01-14-2010, 04:46 AM
That's really great serge :D and thanks a heap for the explanations. Believe me I need them :)

Can't wait to try it as I started moving them by hand (only did about 40 of them ) before going a bit nuts :)

The deadline is somewhat extended so might still squeeze all that nodal goodness in. Thanks a bunch mate, I owe you one.

adk.

serge
01-14-2010, 01:21 PM
... I owe you one...
"Someday, and that day may never come, I will call upon you to do a service for me. But until that day, accept this as a gift..."

No problem. It was a good exercise for me.

serge
01-15-2010, 06:23 AM
Forgot to add: in the Part Move node, "Pivot" needs to be set to "Down", so the bottom (instead of the default "center") of the part will be aligned to the ground object.

adk
01-17-2010, 04:06 PM
You saying you want to be the Godfather of my kids serge :D :thumbsup:

Sorry for the late testing of this, which works like a charm btw, but I've been away from the office for 3 days. Once again thanks for the explanations, they saved the day. I'll post up a pic as soon as I'm done with the sucker.

I've needed something like this, which works across parts rather than points (where KO_Pointfit works most of the time), for so long that now I'm kicking myself for not posting it sooner.

I remember posting a request at the now extinct LW-developers/plugin forum (don't remember it's name) about creating something like this before DP Kit made it onto the scene. Amazing what's possible with nodes.

adk




"Someday, and that day may never come, I will call upon you to do a service for me. But until that day, accept this as a gift..."

No problem. It was a good exercise for me.