Help Ideas to improve fly fishing simulation - 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 Ideas to improve fly fishing simulation (/thread-909.html) Pages:
1
2
|
Ideas to improve fly fishing simulation - ChumLee - 17-02-2019 I've been tinkering with a fly fishing simulator in VR. I attached an ObiRope to the end of a 3m rod. I'm actually surprised how well things tend to work in general; I'm far away form truly replicating what happens you overhand cast a fly line, but I feel like there is potential. Here's what I'm trying to simulate.... There's a lot going on here obviously; aerodynamics probably play a large role, and I assume ObiRope doesn't take into account. So, I doubt this can be replicated simply by placing an ObiRope at the end of a cylinder, but I still want to try... Some questions I have: 1: How can I make the ObiRope not pivot 360 degrees around the fixed particle at the end of the rod. Any movement that is slightly off course can easily make the rope helicopter around the tip of the rod. Is there any way to encourage the line to only move in a certain plane? (i.e. the plane the rod is moving through). 2: What knobs do I have to reduce the strechiness of the rope... The only thing that I have found effective is reducing the resolution, i.e. number of particles, in the rope... What else can I do? Any other ideas about how to achieve this effect are welcome! RE: Ideas to improve fly fishing simulation - josemendez - 17-02-2019 (17-02-2019, 05:24 AM)ChumLee Wrote: 1: How can I make the ObiRope not pivot 360 degrees around the fixed particle at the end of the rod. Any movement that is slightly off course can easily make the rope helicopter around the tip of the rod. Is there any way to encourage the line to only move in a certain plane? (i.e. the plane the rod is moving through). You could fix the first few particles (2-3) at the beginning of the rope, near the end of the rod. This will allow bend constraints to prevent the rope from pivoting around a single particle, because the first few particles define a straight line that is propagated as the "intended" direction. Make sure you do use bend constraints though! (17-02-2019, 05:24 AM)ChumLee Wrote: 2: What knobs do I have to reduce the strechiness of the rope... The only thing that I have found effective is reducing the resolution, i.e. number of particles, in the rope... What else can I do? Increase the amount of distance constraint iterations (these constraint particles along the rope to be at a fixed distance from each other). The higher the amount of iterations, the costlier/higher quality the simulation will be. However ropes have very few constraints compared to cloth or soft bodies for instance, so you can crank this very high with little consequences. You can also increase the amount of solver substeps. This has the effect of performing the entire simulation multiple times in a single physics timestep, greatly increasing accuracy. Both settings (iteration count and substep count) are found in the ObiSolver component. 2-5 substeps and 5-10 iterations should suffice. http://obi.virtualmethodstudio.com/tutorials/obisolver.html The effect seen in the image is not due to aerodynamics, but the fact that the tip of the rope is heavier than the rest of it. Simply attaching something heavy to the tip, or better yet increasing the mass of the particles at the tip should work. Btw Obi does take aerodynamics into account (a quite simplified version of true aerodynamics), but only when a ObiForceZone (ObiAmbientForceZone or ObiSphericalForceZone) is present in the scene. RE: Ideas to improve fly fishing simulation - ChumLee - 17-02-2019 Thanks a ton for the guidance Jose; I'll try these suggestions and share the results if i can get something working! RE: Ideas to improve fly fishing simulation - ChumLee - 17-02-2019 (17-02-2019, 12:39 PM)josemendez Wrote: You could fix the first few particles (2-3) at the beginning of the rope, near the end of the rod. This will allow bend constraints to prevent the rope from pivoting around a single particle, because the first few particles define a straight line that is propagated as the "intended" direction. Make sure you do use bend constraints though! Would cranking up the anisotropy setting of the solver also help? Fixing the last few segments really didn't help too much. The rope just spins around the last unfixed segment. Quote:The effect seen in the image is not due to aerodynamics, but the fact that the tip of the rope is heavier than the rest of it. Simply attaching something heavy to the tip, or better yet increasing the mass of the particles at the tip should work. I ended up increasing the mass of the particles at the end of the line. For a fly fishing line, I'm guessing I may want to go lighter than the default .1 (kg?)? Thinking more, I could get really fancy here and actually mimic the weight profile of a typical fly line, which is usually tapered with the head section being the heaviest. Here's where I'm at so far: http://imgur.com/a/CDNf6xd Notes...
The next big thing I want to try is adding some flex to the rod itself, i.e. mimic a fly rod. My theory is that having the rod flex where the rope is attached will reduce the chance that the line will snap back. RE: Ideas to improve fly fishing simulation - josemendez - 18-02-2019 Quote:Would cranking up the anisotropy setting of the solver also help? Fixing the last few segments really didn't help too much. The rope just spins around the last unfixed segment. Nope, anisotropy affects the shape of the particles, but does not have any effect on the physical behavior of the rope. Quote:[*]The rope feels too much like a rubber band; It is really springy.[*] Increase the amount of solver substeps, or decrease Unity's timestep. Playing a bit with the solver's damping setting (but keeping it relatively low) could also help. Quote:[*]The rope is too stiff.[*] [*] Reduce bending constraint stiffness, and/or increase their max bending. Setting max bending to 0.02-0.05 generally works well. RE: Ideas to improve fly fishing simulation - ChumLee - 21-02-2019 Thanks for these suggestions. Really helpful! It's starting to resemble an actual fly fishing line. Another question: is there are a way to attach an Obi Rope to the end of an Obi Rod? I see that you can attach Unity rigid bodies to Obi objects, but I haven't seen anything about attaching Obi objects together. I've already used an Obi Rod to mimic the flex profile of a fly rod (see below). That's all good in a visual sense, but the missing ingredient is actually having the line follow the rod tip as it bends. Right now the line, a sibling game object of the rod, is just using fixed particles to position itself. So as the rod flexes, the line doesn't react, i.e. they are being simulated independently. Ideally, I'd be able to fix the first few rope particles to the final particle at the top of the rod. Is there a way to do that? Is it possible with scripting? Maybe after the rod's particles have been simulated, I could loop over the rope's particles and make them line up with the nearest rod particles. I doubt it's possible to get this sort of fine-grain control over the execution order of the physics engine and Unity scripts though... RE: Ideas to improve fly fishing simulation - josemendez - 21-02-2019 (21-02-2019, 09:37 AM)ChumLee Wrote: Thanks for these suggestions. Really helpful! It's starting to resemble an actual fly fishing line. You could do this in several ways. Using stitch constraints to attach the last particle or the rod to the first particle of the rope is a possibility, however this would add an additional constraint between both particles that would not look very good when swinging at high speeds. Another (better) possibility is to position the rope transform at the end of the rod every physics step, by copying the particle's position/orientation to the rope's transform. You can get particle properties such as positions and orientations quite easily: http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html RE: Ideas to improve fly fishing simulation - ChumLee - 21-02-2019 (21-02-2019, 09:43 AM)josemendez Wrote: You could do this in several ways. Is there a way for the rod to get impulses from the rope as well? Is this what the stitcher does? It seems like with the physics step scripting approach, it's more just matching the rope's position to the rod. Ideally though, if there's weight at the end of the line (fish!) then the rope would tighten up and the rod would bend in response. RE: Ideas to improve fly fishing simulation - josemendez - 21-02-2019 (21-02-2019, 10:14 AM)ChumLee Wrote: Is there a way for the rod to get impulses from the rope as well? Is this what the stitcher does? It seems like with the physics step scripting approach, it's more just matching the rope's position to the rod. Ideally though, if there's weight at the end of the line (fish!) then the rope would tighten up and the rod would bend in response. Good point! In that case, using a constraint is the only way. I made a short video on how to use the ObiStitcher component. The two important remarks are: - Since the rod and the rope now share a constraint, both have to use the same ObiSolver. - Add the ObiStitcher component to any of them, then use its edit mode to create a stitch between the rod and the rope. At the end of the video, I crank up the amount of substeps to make the simulation more snappy, and increase damping to reduce vibrational motion. RE: Ideas to improve fly fishing simulation - ChumLee - 22-02-2019 (21-02-2019, 10:57 AM)josemendez Wrote: Good point! In that case, using a constraint is the only way. Awesome!! Thanks for demo. That helped a lot. Here's what I have working now: https://imgur.com/a/QVKpUx6 Having the rod flex definitely improves the feel in VR as well... Now that I'm using the stitcher, I noticed a cursor that I had placed at the top of rope no longer works... Is that expected? Are cursors and stitchers compatible? |