Google Groups Home
Help | Sign in
Rope of CircleParticle and SpringContraint is stretching.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Celar  
View profile
 More options Jun 26, 6:03 am
From: Celar <arjan.cee...@gmail.com>
Date: Thu, 26 Jun 2008 03:03:34 -0700 (PDT)
Local: Thurs, Jun 26 2008 6:03 am
Subject: Rope of CircleParticle and SpringContraint is stretching.
Hello,

I created a chain of CircleParticles connected to each other with
SpringContraints. One CircleParticle is draggable. I want the chain
(rope) to hold his length. Now is stretches out according how far you
would drag the circleparticle.

I build is with Flash CS3 so this code can be placed on the first
frame. No extra classes build yet. I added one extra class
"DragableCircleParticle" which can be found in the files from this
group (http://groups.google.com/group/ape-general/files).

import org.cove.ape.*;

APEngine.init(1/4);
APEngine.container = this;
APEngine.addMasslessForce(new Vector(0,8));

var color1:uint = 0x00ff00;
var color2:uint = 0xff00ff;

var defaultGroup:Group = new Group();
defaultGroup.collideInternal = true;

var anker:CircleParticle = new CircleParticle(240,0,10, true);
defaultGroup.addParticle(anker);

var cp1:CircleParticle = new CircleParticle(250,10,1);
defaultGroup.addParticle(cp1);

var sc1:SpringConstraint = new SpringConstraint(anker, cp1, 0.5,
false, 1);
        sc1.restLength = 10;
sc1.setStyle(1, color1, 1, color2);
defaultGroup.addConstraint(sc1);

var cp2:CircleParticle = new CircleParticle(250,20,1);
defaultGroup.addParticle(cp2);

var sc2:SpringConstraint = new SpringConstraint(cp1, cp2, 0.5, false,
1);
        sc2.restLength = 10;
sc2.setStyle(1, color1, 1, color2);
defaultGroup.addConstraint(sc2);

var cp3:DragableCircleParticle = new DragableCircleParticle(250,30,5);
defaultGroup.addParticle(cp3);

var sc3:SpringConstraint = new SpringConstraint(cp2, cp3, 0.5, false,
1);
sc3.setStyle(1, color1, 1, color2);
defaultGroup.addConstraint(sc3);

var cp4:CircleParticle = new CircleParticle(250,20,1);
defaultGroup.addParticle(cp4);

var sc4:SpringConstraint = new SpringConstraint(cp3, cp4, 0.5, false,
1);
sc4.setStyle(1, color1, 1, color2);
defaultGroup.addConstraint(sc4);

var cp5:CircleParticle = new CircleParticle(250,10,1);
defaultGroup.addParticle(cp5);

var sc5:SpringConstraint = new SpringConstraint(cp4, cp5, 0.5, false,
1);
sc5.setStyle(1, color1, 1, color2);
defaultGroup.addConstraint(sc5);

var sc6:SpringConstraint = new SpringConstraint(cp5, anker, 0.5,
false, 1);
sc6.setStyle(1, color1, 1, color2);
defaultGroup.addConstraint(sc6);

APEngine.addGroup(defaultGroup);

addEventListener(Event.ENTER_FRAME, run);

function run(evt:Event):void {
        APEngine.step();
        APEngine.paint();

}

function mouseDownHandler(evt:Event):void {
                trace("click");


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ben  
View profile
 More options Jul 7, 8:37 am
From: ben <benjamin.fouc...@club.fr>
Date: Mon, 7 Jul 2008 05:37:57 -0700 (PDT)
Local: Mon, Jul 7 2008 8:37 am
Subject: Re: Rope of CircleParticle and SpringContraint is stretching.
Hello !

I'm not sure but what you're seraching for is create a chain with
constraints but no elasticity, and that can move where you drag it ???
Is it ????


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Celar  
View profile
 More options Jul 7, 11:30 am
From: Celar <arjan.cee...@gmail.com>
Date: Mon, 7 Jul 2008 08:30:52 -0700 (PDT)
Local: Mon, Jul 7 2008 11:30 am
Subject: Re: Rope of CircleParticle and SpringContraint is stretching.
Yes I want to create a chain with an object (label with text) attached
to it. But in the normal world the chain won't stretch (for example an
metal chain can't stretch).
The main problem is the stretching of the SpringConstraint. I want the
length to be an fixed length.

On 7 jul, 14:37, ben <benjamin.fouc...@club.fr> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jaye  
View profile
 More options Sep 2, 1:18 pm
From: Jaye <jaye.how...@alconemarketing.com>
Date: Tue, 2 Sep 2008 10:18:08 -0700 (PDT)
Local: Tues, Sep 2 2008 1:18 pm
Subject: Re: Rope of CircleParticle and SpringContraint is stretching.
What if you set the Stiffness value to 1...would that keep it from
stretching?

Sorry if this is an obvious wrong answer, I just started using APE. I
am searching for a solution to curved surfaces and have been toying
with the idea of making the curve or arc with a section of stiff
spring objects. Imagine taking the bridge example from the car demo
and laying it in an arc, placing the circle particles in a fixed
position and setting the spring value to the stiffest setting to
prevent stretching.

In your case, Celar, you would leave the circle particles' position
unfixed.

On Jul 7, 8:30 am, Celar <arjan.cee...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google