Jump to content

[SOLVED] Creating Rope/Cables


photo

Recommended Posts

Hi guys,

 

I am trying to set up a simple rope object, and can't seem to be able to get it to work.

 

I just want to attach a piece of rope to two points in space, in this example from one electricity pylon to another.

 

Is there any documentation/could you give me some tips on how to achieve this?

 

I've tried looking at the samples provided but haven't been able to figure it out.

 

Many thanks,

 

Ed

Link to comment

Hi Ed,

Sorry, we haven't got a tutorial on creating ropes (or binding ropes with geometry) and I'll explain you how to do that in UnigineEditor. Let's begin:

I'd recommend you not to bind the rope mesh with the geometry (electricity pylons).

First, disable the physics in the editor. By default, the key combination is Ctrl + Space.

Then create a dummy node (Create -> Node -> Dummy). It will be a container for our rope.

Then create 2 dummy objects (Create -> Object -> Dummy) and make them children of the container dummy node. Let call them bind points. Assign Dummy bodies to these objects and shapes (for example, box shape) and specify their sizes (for example (0.5 0.5 0.5)). Place these bind points near each other.

Add the rope geometry and place it between these dummy objects. Make this rope also a child of the dummy node container. Make sure that the end points of the rope a connected (their bounds have an intersection) with these bind points. Assign the Rope Body to the rope geometry.

Select the bind point and add the Particles joint to the rope body. When you add it, you'll create the anchor of the joint (by default it is a box with the (1.0 1.0 1.0) size. Specify the necessary size, but the anchor bounds should intersect the rope (it's important!). Perform the same operation for the second bind point.

Finally, activate the physics! Voila!

You can move the dummy object and the rope will stretch. Place dummy objects to the necessary places on your electricity pylon, assign a material for the rope, etc. Copy the whole node dummy container and you'll get another rope.

The essential thing to understand: after creating joints and specifying its anchors, the engine binds such points of the rope, that intersected (were in the bounding box) with the anchor bounds.

The logic from the code remains the same.
I also attached a node layer with the created rope. If you have a UNIGINE 2.0, just add it to the scene by clicking Create -> Node -> Layer and choose the node layer file. 

Thanks and sorry for inconvenience caused.

rope_setup.node

Link to comment
  • 4 months later...

I was thinking about creating dynamic chain on similar principle. Use model of one chain ring and specify how many rings will such chain have and then use two anchors for placing chain somewhere. Is this possible without coding?

 

Then I can export such dynamic chain into static mesh. It would allow fast creation of realistic ropes, chains, etc...

Link to comment
×
×
  • Create New...