Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Compressed rope
#1
Pregunta 
Hi evryone!
How i can immitate flat rope?
I think find where used variable thickness, and change to Vector2. And on create mesh multiply for variable. 

I can do it? And how this will affect for others?
Reply
#2
(20-03-2020, 08:19 AM)Urbem Wrote: Hi evryone!
How i can immitate flat rope?
I think find where used variable thickness, and change to Vector2. And on create mesh multiply for variable. 

I can do it? And how this will affect for others?

Can't you just use a different rope section asset? ObiRopeExtrudedRenderer takes a section as parameter, which is the 2D shape extruded along the rope curve. The default one is a 8-segment circle, but you can use a ellipse, a star, or basically anything.

To create your own section, right click on a project folder, and go to Create->Obi->Rope Section. Then you can click and drag the vertices in the section to create the shape you need.
Reply
#3
Thnk for answer, but I need in round rope, create small flat piece(in whole rope)
Reply
#4
(20-03-2020, 01:50 PM)Urbem Wrote: Thnk for answer, but I need in round rope, create small flat piece(in whole rope)

The shape of the section you use affects the whole rope. Maybe I'm not getting what you mean? could you share a pic of what you're after?
Reply
#5
I need create rope like this:
   
Without using a Render mesh, only the Obi Rope Extrudet Renderer. No compression on both axes (only one axis)
Reply
#6
(23-03-2020, 09:15 AM)Urbem Wrote: I need create rope like this:

Without using a Render mesh, only the Obi Rope Extrudet Renderer. No compression on both axes (only one axis)

Hi,

So actually you only need a certain section of the rope to be compressed (not the whole rope), smoothly merging with the surrounding rope, and for some reason you cannot/don't want to use the ObiRopeMeshRenderer to achieve it, right? In that case, you'd need to implement your own renderer from scratch, or modify the extruded renderer.

There's several possible routes you could go:

Method #1:- If you don't need precise per-control point control, you could simply scale the extruded shape along one axis in ObiRopeExtrudedRenderer, using the current curve frame count as an approximate way to determine where you are along the rope length. Multiplying scaledNormal or scaledBinormal by a 0-1 factor in the inner loop of the UpdateRenderer() method will accomplish this.

This is the easiest way to do it, but you won't be able to precisely control where the "flat" zones appear.

Method #2:- Provided that you don't need to use vertex colors, you could repurpose control point color (which is already interpolated across particles) to a 2D "axial scale" of "flatness" value, using it to drive mesh extrusion in the renderer. This does not require you to mess with the ObiPath (spline) implementation, but still lets you control flatness using the path editor. All you'd need to do is interpret curve[i].color as a 2D scale factor in the renderer, do something like:

Code:
scaledNormal *= curve[i].color.r;
scaledBinormal *= curve[i].color.g;

This will interpret the red channel as the normal scale, and the green channel as the binormal scale. Editing flatness in the path editor will be awkward though, as you'd need to think of control point color values as vectors.

Method #3:- You could add an entirely new per-control point "flatness" or "axial scale" property, and use that to drive mesh extrusion instead. This would require you to modify the ObiPath, ObiPathFrame and ObiPathEditor classes, to include the new per-control point property. This is the best, most flexible, tightly integrated method, but requires pretty in-depth knowledge though. Don't recommend it unless you're good at reading/interpreting code and don't mind getting your hands dirty.


Keep in mind though, that ropes do not model torsion, so you have no control over rotation around the longitudinal axis. This is not a problem if your rope section is radially symmetric, but yours isn't. If you need control over torsion, a rod should be used instead of a rope.
Reply