Help Scale Rope in Runtime - 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 Scale Rope in Runtime (/thread-799.html) |
Scale Rope in Runtime - ObiWan6565 - 22-12-2018 Hi, I'm trying to create a chain with a few links so that it is in scale with other objects in my AR scene. How do I change the scale of the chain in runtime without changing the amount of links or the length of the rope? Thanks in advance. RE: Scale Rope in Runtime - josemendez - 23-12-2018 (22-12-2018, 03:39 AM)ObiWan6565 Wrote: Hi, I'm trying to create a chain with a few links so that it is in scale with other objects in my AR scene. Use local-space simulation: http://obi.virtualmethodstudio.com/tutorials/localspace.html RE: Scale Rope in Runtime - ObiWan6565 - 27-12-2018 (23-12-2018, 07:25 PM)josemendez Wrote: Use local-space simulation: Hi Jose, Thank you for the quick response. I tried switching to the local space simulation but with a FixedUpdate of 30fps the program just crashes, so maybe it's way too many simulations/sec for ObiSolver to handle? Below is a more detailed description of what I'm trying to achieve: In my AR game, I've managed to attach a virtual ball and chain to a person's hand by using the RGB feed of a simple webcam. The chain rendering mode works perfectly for this and I'm really happy with the results. However when the person walks back and forth from the webcam, I want the chain to scale accordingly: [attachment=212] Rigidbodies scale perfectly but when I scale the rope object, the links either separate out (when scale is decreased) or move closer to each other (when scale increased) and I was wondering if there's a simpler way to achieve this procedurally, during runtime without changing the length or the number of particles in the rope? Thanks, RE: Scale Rope in Runtime - josemendez - 27-12-2018 (27-12-2018, 01:30 AM)ObiWan6565 Wrote: Hi Jose, Imho if you're going for a perspective effect, you should use a perspective camera that matches the webcam's parameters (fov). This way you'd get correct scaling automatically, no need to fake it. If you still want to go the scaling route, the only way to correctly scale a simulation as a whole is to use local space mode. You cannot scale a rope in world space mode, as that would only scale fixed particles. Make sure you've set it up correctly (rope must sit under the solver transform). RE: Scale Rope in Runtime - ObiWan6565 - 27-12-2018 (27-12-2018, 09:36 AM)josemendez Wrote: Imho if you're going for a perspective effect, you should use a perspective camera that matches the webcam's parameters (fov). This way you'd get correct scaling automatically, no need to fake it. Thank you! That's exactly what I ended up doing |