Hanging and dangle an object


#1

Hi everybody!
Does someone know if it’s possible to create a pivot or a constriction point and hanging an object like a rope or a picture on a wall?

I tried simulating a sort of hook, but unfortunately it’s impossible to create groups of objects with the collision edge more complex then 4 sides


(Greg) #2

If you hit the “Command” key on an element you’ll see a center point that you can drag to set the rotation center of the element.


#3

Cool thanks.
but I was wondering if it’s possible doing something like this:

but not animating it by the timeline, but using gravity and physics


(Greg) #4

Not that I know of, sorry


(René) #5

It’s possible. I build something like this with the accelerometer that changes the rotation. The only thing is that the rope is a long static thing and it wil not bounce.


#6

Hi Renè,
It could be enough for me!
In fact I don’t need to animate a rope, but just stuff hanging on a wall.

If you find the your project, can you please attach it here to help me and the next one?
Thanks!


(René) #7

You can achieve this with the device orientation, more about that overhere.


#8

Hi Renè thanks a lot, but apparently I have not access to your project page.
“Sorry, you don’t have access to that topic!”

Do you know perhaps why, or I should ask to an administrator?

Thanks


(René) #9

You can download a example project overhere:
lamp-device-orientation.zip (13.5 KB)

It uses eventData.beta so it only works in landscape mode.


#10

Hi Renè,
thanks it’s working perfectly.

I was just trying to use it in portrait but the behaviour looks weird.

window.addEventListener('deviceorientation', function(eventData) {
	var vBeta = eventData.alpha
	var vWindowOrientation = window.orientation;
	if (vWindowOrientation == 0){
		vBeta = vBeta * 1;
	};
	vLamp.style.webkitTransform = 'rotate(' + vBeta + 'deg)';
});

(René) #11

Works great overhere


#12

In portrait it works much better using "gamma"
Really I don’t know why


#13

Hi Everyone!

I was curious to know if you may know of a way to use device orientation to control a timeline?

Thanks!

Logan


#14

Do you mean device tilt? Or switching from portrait to landscape?


#15

Hey Daniel,

Device tilt to advance or reverse a timeline. Much in the same way the device tilt can move the lamp.

Thanks!!

Logan