Regarding attaching (or wrapping) objects to a surface, most approaches found on the internet involve unwrapping the surface into a flat plane and placing objects on it, then using the flowAlongSrf command to “flow” them back onto the original surface.
However, there are two problems associated with this command:
It functions more like a mapping operation, where the final size of the objects is determined by the ratio between the two surfaces instead of itself.
The objects are affected by the UV structure of the surface. For example, if you flow a box at different locations on a sphere, you’ll experience varying degrees of distortion.
What I want:
I am looking for a way for objects to truly flow across the surface, akin to pulling a train along a track on the surface, that is not sensitive to surface’s UV structure.
Many racing games, such as RR3 and the NFS series, have achieved this feature. They allow you to spray a texture onto the car body and move, rotate, or scale it without obvious distortion.
I am aware they based on mesh technology, but I believe there should be a corresponding method for NURBS surfaces.
I really hope there is a viable solution to this problem.
Have you tried FlowAlongSrf with the option Rigid=Yes? That flows objects along a surface without distorting the individual items.
Unless a curved surface is “developable” any mapping from a flat surface to the curved surface will inevitably have some distortion. That is how geometry works.
When using FlowAlongSrf the distortion can be influenced/controlled by the choice of the flat surface used as the base surface. Try creating the base surface using Squish and experiment with the options in Squish. You can also use any of the surface transformation tools to modify the base surface before using it.
Making an intermediate proxy flowing surface can help with that.
Of course what you’re asking for is literally impossible, if it’s for objects to ‘actually’ flow along the surface instead of just float near it, and some feature in a game engine means absolutely nothing. If you want to literally flow a train on a track on the surface, then you can maybe flow along a curve instead.
Yeah, you’re right. Some distortion is inevitable.
In fact, I am not trying to avoid the distortion of individual items, but rather the distortion of the whole object that is caused by the UV structure of the surface.
You can imagine that when you drive a train on the surface of a sphere, as the train moves from the equator to the North Pole, its shape should remain consistent. However, flowAlongSrf does not work as desired. Your train becomes thinner and thinner, eventually becoming a point. And this is what I want to avoid: the influence of the surface’s structure.
Flowing along a curve cannot maintain the correct orientation due to the lack of a normal direction at every point on the path.
I don’t think that game engines mean nothing; they also follow the rules of geometry. The differences between meshes and nurbs are not the key factors in this problem.
Well we need to see an actual example here instead of just claiming it’s some magic feature. Yes the difference between meshes and nurbs is the problem. Rhino was the first product that could do this sort of thing on joined NURBS objects.
Then you need to flow along a curve, or make some sort of ribbon-like surface to flow along. So really what you want is something completely different from FlowalongSrf.
Fin with Direction=Tangent and Flip=No to create the “ribbon” surface along one side of the curve.
Fin using edge of the first “ribbon” surface with Direction=Tangent and Flip=Yes to create the ribbon surface along other side of the curve.
MergeSrf with Smooth=Yes Round=1 to merge the ribbon surfaces into a single surface. (When a BothSides option is added to Fin the above proceedure will be simplified to a single use of Fin. Request fo the this addition has been on the list since 2006.)
UnRollSrfUV the merged ribbon surface and select the original curve to also unroll.
Place the objects along the unrolled curve.
FlowAlongSrf the objects using the unrolled ribbon surface as the base and the ribbon surface as the target.
@davidcockey@JimCarruthers
Thank you, David and Jim, for offering me a feasible approach to flow an object onto a surface with acceptable distortion. This has almost solved my practical problem.
I just think there should be a more ideal way to do this. Consider the input conditions: a surface, a point on the surface as the start, and a tangent vector at the point indicating the object’s direction. Using these conditions, the final result should be calculable. However, there is no such tool available yet. I’m not 100% sure this method follows the rules of geometry, so I posted this topic to find an answer.
The solution is just to automate what David laid out. What you want is not by any stretch of the imagination what FlowAlongSrf does, it’s flowing along a curve normal to a surface. Completely different thing, and is really only going to work in narrow situations.