Help How to align the first 2/3 and last particles of a rope to do a realistic cable ? - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help How to align the first 2/3 and last particles of a rope to do a realistic cable ? (/thread-505.html) |
How to align the first 2/3 and last particles of a rope to do a realistic cable ? - Darkroll - 28-03-2018 Hi, I'm trying to do a RJ45 cable using Obi Rope. The thing is that I need to have a plug male on each side ( Start and End ) with their own scripts so I can't use the Start and End prefab feature of Obi Rope. The first thing I did was to use Pin constraints which is working well in terms of logic. I can grab both start and end plugs and the rope. But in terms of realism, it's not good because pin constraint is on a particle so the cable is able to turn all around a plug. So, I'm currently using the same logic that the moving ropes in the "RopeShowcase" sample scene by putting the rope as a child of a plug and using an Obi Handle and two fixed particles to force the cable to be aligned with the plug. Here is what I have now. But I'm able to do it only on one side because, of course, the rope can't be a child of the start and end plug at the same time. Also, if I grab the cable, the plug doesn't move according to it like when I'm using pin constraint. Which is logical because of the parenting and the Obi Handle. I'm really out of ideas to manage how doing it by myself so if you can help me Thanks ! Killian RE: How to align the first 2/3 and last particles of a rope to do a realistic cable ? - josemendez - 28-03-2018 (28-03-2018, 08:57 AM)Darkroll Wrote: The first thing I did was to use Pin constraints which is working well in terms of logic. I can grab both start and end plugs and the rope. But in terms of realism, it's not good because pin constraint is on a particle so the cable is able to turn all around a plug. I'm under the impression that you're trying to force a certain twist on the rope (to control its orientation along its length). This is not possible, ObiRope particles are just points in space, with no orientation. RE: How to align the first 2/3 and last particles of a rope to do a realistic cable ? - Darkroll - 28-03-2018 (28-03-2018, 12:26 PM)josemendez Wrote: I'm under the impression that you're trying to force a certain twist on the rope (to control its orientation along its length). This is not possible, ObiRope particles are just points in space, with no orientation. Hi ! Thanks for your answer But no, I'm not trying to control its orientation along its length. I mean, I just want to reproduce this, but on both sides. I already did it for one side (my first picture) but as I said, the rope needs to be child of the object which have the Obi Handle because the 2 first particles needs to be fixed to have this "curve" and avoid the cable to fall down directly like this. To have a nice curve when I grab my RJ45 plug. Thanks again RE: How to align the first 2/3 and last particles of a rope to do a realistic cable ? - Darkroll - 23-04-2018 Hi all, I don't know if I should create a new thread or not, but I figured out how to do it and that could interest someone else. So, just to remind, I was trying to "force" the rope to have the firsts particles aligned when I grab one or both of the Start and EndPrefab. ( see my previous post ) Just an update, since last time I have added the possibility to grab the ObiRope following this thread and the VRTK_ObiRopeInteraction and VRTK_ObiRopeSolver scripts. What I did is putting my RJ45 Prefab, which is grabbable, as a StartPrefab and EndPrefab of the ObiRope and modified the PlaceObjectAtCurveFrame's function in the ObiRope script. Actually, this function is replacing, every frame, the Start and End GameObject following the curve of the rope (position + rotation). So when I'm grabbing the rope, the prefabs are moving properly according to it. But the thing is I don't want that the rope "control" the GameObject's orientation while I grabbing it but conversely, I want to control the curve of the rope (not to twist it) while I grabbing a cable end. This is my code : Code: private void PlaceObjectAtCurveFrame(CurveFrame frame, GameObject obj, Space space, bool reverseLookDirection) I hope it's going to be helpful if someone wants to do the same . Please ask if you have any question about the code or how I did it. |