P2P Questions (and answers hopefully)

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
bmud
Posts: 17
Joined: Sat Jun 03, 2006 7:36 pm
Location: Raleigh, NC USA

P2P Questions (and answers hopefully)

Post by bmud »

I'm going to kick off this with a question of my own. I opened up the demonstration file, attempted to make my own by copying the code into a file of my own. I imagine that documentation will take care of "you need a constraint variable for each axis for each object" blah blah.

Nevertheless, I noticed that if I use just the demo file, and delete everything except the white "rope" in the top-middle, it doesn't act like a rope when you click on any part. The bottom ball is constrained to its original location. how does one have free ends to simulate something like a hanging rope?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: P2P Questions (and answers hopefully)

Post by Erwin Coumans »

bmud wrote:I'm going to kick off this with a question of my own. I opened up the demonstration file, attempted to make my own by copying the code into a file of my own. I imagine that documentation will take care of "you need a constraint variable for each axis for each object" blah blah.
I was planning to add a ConstraintActuator, that should make things much simpler. Also, Ramon (rcruiz) is working on setting up constraint within the Blender user interface.
Nevertheless, I noticed that if I use just the demo file, and delete everything except the white "rope" in the top-middle, it doesn't act like a rope when you click on any part. The bottom ball is constrained to its original location. how does one have free ends to simulate something like a hanging rope?
The python script that handles clicking applies the wrong impulse. Will be fixed. Also, you can just remove one constraint, if you want to have a free end to the rope. I'll provide a better rope demo.
bmud
Posts: 17
Joined: Sat Jun 03, 2006 7:36 pm
Location: Raleigh, NC USA

Outta control!

Post by bmud »

I'd like to know if there's a way to reduce or eliminate the spinning in a chain of constrained pieces. Its no good to have the parts of a chain independently spinning length-wise all crazy-like.

if such a thing was possible, i don't think I'd be having nearly as much trouble with this rope bridge
pildanovak
Posts: 50
Joined: Thu Jul 14, 2005 1:55 pm

Post by pildanovak »

hello, you're only using 1 constraints per connection, which is no good :). look at the brige I made from yours here :
plant.ffa.vutbr.cz/~novak/dwnflz/constraints.blend

look in the script constraint.py, where are the constraints defined. I reduced the number of objects(was too much, better doing a bridge from more planks in row, than having separate objects for rope pieces, etc.) I was planning to add bridges to my game anyway, so at least I know how to code it now. Look also at the pivot definition, it's important, since it defines the point where the objects get connected...

Hey, I just probably helped my competitor! :?: :? :D
bmud
Posts: 17
Joined: Sat Jun 03, 2006 7:36 pm
Location: Raleigh, NC USA

Post by bmud »

That's very curious. Now I'm confused as to what a constraint actually IS. a point (defined in the code by a local x/y/z coordinate from its axis?) where.... it's simply... connected to another object? That makes probably the most sense.

I'll conquer it yet!
pildanovak
Posts: 50
Joined: Thu Jul 14, 2005 1:55 pm

Post by pildanovak »

p2p means point to point constraint, so yes, it's connection of 2 objects with 1 point, for the bridge you could also use the hinge constraint, which is defined by an axis/common edge of the objects.