PURE DATA forum~

...that deal with pure data

You are not logged in.

#1 2012-05-02 01:20:09

flybynight
Member

How to make an object rotate in an orbit

I have actually done this a couple of years ago but forgotten quite how. I know I used the cos object and I think sin.

Could anyone give pointer to me on how one can achieve this.

All I'm after is a circle to rotate around a point, like a planet rotating around the sun. Just 2D.

Are radians required, or is it more simple.

Offline

 

#2 2012-05-02 14:55:34

flybynight
Member

Re: How to make an object rotate in an orbit

Anyone? :s

Offline

 

#3 2012-05-02 15:52:05

dwan
Member

Re: How to make an object rotate in an orbit

It's just a matter of using [translateXYZ] and [rotateXYZ] in the right order ;)

Last edited by dwan (2012-05-02 15:52:22)


Attachments:
Attachment Icon orbit.pd, Size: 1,194 bytes, Downloads: 70

Offline

 

#4 2012-05-02 23:38:17

flybynight
Member

Re: How to make an object rotate in an orbit

Ah, thanks a lot, it's a different method to what I used before.

Thank you - really helped me out.

Offline

 

#5 2012-05-03 17:59:32

nestor
Member

Re: How to make an object rotate in an orbit

You can certainly do it with sin and cos as well.   sin and cos accept radians, and you can use their output as coordinates to position an object on a circle.  I find this is a better way, because you do not need to separate the transform if you want to transform further or use recursion.

Offline

 

#6 2012-05-03 18:50:49

dwan
Member

Re: How to make an object rotate in an orbit

sin and cos version attached ;)


Attachments:
Attachment Icon orbit2.pd, Size: 1,833 bytes, Downloads: 75

Offline

 

#7 2012-05-03 19:52:12

flybynight
Member

Re: How to make an object rotate in an orbit

Thanks again dwan, all this stuff is seriously useful to help my understanding, and hopefully others' too.

Offline

 
  • Index
  •  » pixel#
  •  » How to make an object rotate in an orbit

Board footer

Powered by PunBB
Copyright 20022005 Rickard Andersson


pd.webring info