Pages

Sunday, July 8, 2012

Revamped Cable Generator!

Hi everyone, I've pretty much completely revamped my cable generator! A great improvement over the old system. Let's start with the problems with the old system. 

One of the major problems in the old system was that if the input curve was not created on the z-axis, there would be a deformation at the start of the cable. This was due to the wirecapture and wiredeform nodes not working as expected.  Hence I set out on the arduous adventure of using VOPs to recreate the spiral. That would also solve my other gripe with the asset, which was that it took at least a second to update in the viewport.


Here is my node network. It functions in the same way as my previous asset, only faster and simpler.

Here is the VOP network. What it's doing is using the normal of the point to manipulate the up vector of the point, essentially rotating the point around the curve. The angle of rotation is being stamped by the copy node controlling the number of copies and is used to maintain even spacing between multiple strands. The second part takes the normalised point number and uses it as a multiplier for the rotation, and functions exactly like the cumulative rotation in the copy node. 

I ran into a couple of problems during the creation of this asset. The first was figuring out a way to create a spiral around the curve without using the wire deformer. I actually stumbled onto the solution by accident, while searching odforce for a solution to another problem. The solution I found was for twisting a ribbon along a curve. However, I realised by translating the point before the VOP SOP would create the spiral pattern perfectly. I also needed to rotate the entire spiral around the curve if multiple spirals would be created. This was the problem that led me to the file mentioned above. I found that by removing the normalised point number from the equation, I could then rotate the entire spiral as I pleased. But this was not enough. I needed it to be controlled by the number of strands present. To achieve this, I stamped an expression from the copy node so the parameter would be controlled by the number of copies.

Another problem that bugged me was the spiral not following the curve properly and instead curved and deformed slightly. I later realised that the centroid() expression should not have been used since I was now copying the point onto the curve directly. Sometimes it's the little details that cause a disaster.

No comments:

Post a Comment