05-09-2024, 06:26 AM
Hello,
I have recently purchased Curvy V8 and need to model twisting objects (e.g. a ribbon). What I want to be able to do is have one end of a spline fixed, and the rest of it free to be twisted an arbitrary number of times. So if it is rotated 720 degrees, it will have two twists which will remain until I apply counter rotations to reverse them. I have tried two approaches so far, and do not understand what needs to happen to get this to work:
1) Using code and a generator to create a mesh that looks like what I need and applying rotations to the X axis of the segments of the associated spline.
2) Modifying the CGDeformMesh_BarbedWire example to use a Cube game object rescaled to look like a ribbon and manually adjusting the X rotation value on the first CP of the spline.
In case 1, I can twist the spline and the entire mesh does rotate but I cannot see how to fix one end, say to a stationary game object. I tried iterating through all of the CPs (rotating each of them) with the exception of the very last point in the spline that I want to remain unrotated, thinking that might work, but it does not. The entire mesh rotates even if I leave out that last point.
In case 2, I can manually change the X axis and get the mesh to twist but as soon as it passes 180 degrees the mesh flips rather than accumulating the multi-turn twists I am after.
How do I attach one end of a spline/mesh so that either the first or the last segment remains fixed and the rest is free to rotate and visually twist up? What would be helpful is a code example showing how to do this. I have looked at the API and it is great if you already know what you are doing but it is very sparse when it comes to example snippets for Curvy beginners. I would appreciate some assistance if anyone has any suggestions as to what I can try.
-thanks
I have recently purchased Curvy V8 and need to model twisting objects (e.g. a ribbon). What I want to be able to do is have one end of a spline fixed, and the rest of it free to be twisted an arbitrary number of times. So if it is rotated 720 degrees, it will have two twists which will remain until I apply counter rotations to reverse them. I have tried two approaches so far, and do not understand what needs to happen to get this to work:
1) Using code and a generator to create a mesh that looks like what I need and applying rotations to the X axis of the segments of the associated spline.
2) Modifying the CGDeformMesh_BarbedWire example to use a Cube game object rescaled to look like a ribbon and manually adjusting the X rotation value on the first CP of the spline.
In case 1, I can twist the spline and the entire mesh does rotate but I cannot see how to fix one end, say to a stationary game object. I tried iterating through all of the CPs (rotating each of them) with the exception of the very last point in the spline that I want to remain unrotated, thinking that might work, but it does not. The entire mesh rotates even if I leave out that last point.
In case 2, I can manually change the X axis and get the mesh to twist but as soon as it passes 180 degrees the mesh flips rather than accumulating the multi-turn twists I am after.
How do I attach one end of a spline/mesh so that either the first or the last segment remains fixed and the rest is free to rotate and visually twist up? What would be helpful is a code example showing how to do this. I have looked at the API and it is great if you already know what you are doing but it is very sparse when it comes to example snippets for Curvy beginners. I would appreciate some assistance if anyone has any suggestions as to what I can try.
-thanks