how to do a pendulum effect?

i would like to know how can I do a pendulum effect for my code

i want to connect a line with a object that have this “connection” and this pendulum effect
someone can light my path?

=d

thanks =* [import]uid: 23063 topic_id: 11552 reply_id: 311552[/import]

Never tried this but I would try hinging the top of the string to a static object with a joint, and then hinging the pendulum to the bottom of the string with a joint. Then apply a horizontal force to the pendulum object.

[import]uid: 58455 topic_id: 11552 reply_id: 41970[/import]

hmmm i will take a look but i guess it’s the same wat that chains sample use

thanks :smiley: [import]uid: 23063 topic_id: 11552 reply_id: 41973[/import]

any luck on this pendulum effect ?

have you tried multiple “links” in the chain ?

im trying to recreate this effect now and having a bit of problem just getting started.

Seems that there is some type of elascticity problem with “chains”.
Are you having these problems as well ?
[import]uid: 11094 topic_id: 11552 reply_id: 73318[/import]

See if horacebury’s responses are helpful

http://developer.anscamobile.com/forum/2011/05/04/windmills-and-pendulums [import]uid: 31262 topic_id: 11552 reply_id: 73336[/import]

i added this code for EVERY link in my chain except for the top most link

[lua]myJointsA[x].isLimitEnabled = true – (boolean)
myJointsA[x]:setRotationLimits( 0, 0)[/lua]

where [x] is each link of the CHAIN.

And it made the CHAIN very stiff and gave me a STIFF pendulmn effect.

Hope this could help those of us…

[import]uid: 11094 topic_id: 11552 reply_id: 73582[/import]

not sure what your looking to do but i did this affect with our logo in the following example.

logo.png is our logo. and logoanchor.png as a 100% transparent PNG i used as a anchor graphic so it wouldnt show up on the screen)

I did this long ago i am sure there are other methods out there. but in this one, all you need to do is add your rope or chain between the anchor and the logo… or object.

[lua] local director = require(“director”) – Director
local physics = require(“physics”)
physics.start()

local function loadmainmenu()
print(“Done”)
end

–local mainmenubackground = display.newImage( “images/mainmenu-bg.png”, 0, 0, true )
local mainmenubackground = display.newImageRect( “images/mainmenu-bg.png”, 960, 1280, true )
mainmenubackground.x = (display.contentWidth/2)
mainmenubackground.y = (display.contentHeight/2)

local logoanchor = display.newImage( “images/logoanchor.png”, display.contentWidth/2, (display.contentHeight/2)-300, true )
physics.addBody( logoanchor,“static”, { density=8, friction=1, bounce=.2, radius=24 } )

if display.contentWidth > 400 then
logo = display.newImage( “images/logo-large.png”, (display.contentWidth/2)-300, (display.contentHeight/2)-123, true )
else
logo = display.newImage( “images/logo.png”, (display.contentWidth/2)-105, (display.contentHeight/2)-37, true )
end
physics.addBody( logo, { density=8, friction=1, bounce=.2, radius=24 } )

local logopivotbottom = physics.newJoint(“pivot”,logoanchor,logo,display.contentWidth/2,(display.contentHeight/2)-300)

logo:applyForce( 4000, 2000, logo.x, logo.y )
logo.linearDamping = 0.1

timer.performWithDelay(7000, loadmainmenu )[/lua] [import]uid: 67604 topic_id: 11552 reply_id: 73593[/import]