Physion

  • Increase font size
  • Default font size
  • Decrease font size
Welcome, Guest
Username Password: Remember me

One rotational axis on two rectangles' corners?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: One rotational axis on two rectangles' corners?

One rotational axis on two rectangles' corners? 2 years, 4 months ago #915

  • Gyros
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Something like the image attached where the two rectangles will rotate on one common axis aligned on their corners. The rectangles should also collide themselves -(not rotating towards the left side).
So, is this possible? This image is hidden for guests. Please log in or register to see it.

P.S If this isn't possible, can you suggest another software that can do this?
Attachments:
  • Attachment This image is hidden for guests. Please log in or register to see it.
Last Edit: 2 years, 4 months ago by Gyros.

Re: One rotational axis on two rectangles' corners? 2 years, 4 months ago #916

  • Lynxx
  • OFFLINE
  • Gold Boarder
  • Java/C#-Developer
  • Posts: 223
It's possible, but complicated ..

I've uploaded a demo-scene:

This image is hidden for guests. Please log in or register to see it.

First i created a rectangle ("Verbindung") the size of the two rectangles which should be connected.
Then i set some values so that it interfere as little as possible with the other objects:
Density to 0,01, Friction & AngularDaming to 0, FilterCategories and FilterMasks to P

Then i created the two rectangles ("BoxLinks" & "BoxRechts") which should be visible and remove P from their FilterCategories and FilterMask. (This means the "Backplane" and the front rectangles cant collide).

Then i created a RevoluteJoint ("HintergrundAchse") over the console with:
world.createRevoluteJoint(Verbindung, null, new QPointF(Verbindung.position().x(), Verbindung.position().y()+0.5), Verbindung.position())


At last i "bolted" the two rectangles to the backplane with:
world.createRevoluteJoint(BoxLinks, Verbindung, new QPointF(BoxLinks.position().x()-4, BoxLinks.position().y()), Verbindung.position())
world.createRevoluteJoint(BoxLinks, Verbindung, new QPointF(BoxLinks.position().x()+4, BoxLinks.position().y()), Verbindung.position())
world.createRevoluteJoint(BoxRechts, Verbindung, new QPointF(BoxRechts.position().x()-4, BoxRechts.position().y()), Verbindung.position())
world.createRevoluteJoint(BoxRechts, Verbindung, new QPointF(BoxRechts.position().x()+4, BoxRechts.position().y()), Verbindung.position())


And finally i moved the backplane and the "Niete..." (the RevoluteJoints which connect the backplane and the rectangles) with ZValue = -1 to the back.

I also tried connecting boxes with DistanctJoints, but that didn't work so well ...
Infinity is vast, especially near end.
bye, Lynxx

Re: One rotational axis on two rectangles' corners? 1 year, 11 months ago #938

Hey.. Holger !!!!
Glad you are alive and well. I've been visiting other 'Planets' too for a while....
Just checked this forum, and noticed this msg from you, stating that you have uploaded
an example of your thoughts, but I can not find it.... (have a few ideas myself), and
explaining some 'bridges' to cross, and software limitations/work-arounds.
Glenn.
1x1 square diag = root-2. Cube diag = root-3. Beautiful !

Re: One rotational axis on two rectangles' corners? 1 year, 11 months ago #940

  • Lynxx
  • OFFLINE
  • Gold Boarder
  • Java/C#-Developer
  • Posts: 223
Glenn555 wrote:
Just checked this forum, and noticed this msg from you, stating that you have uploaded
an example of your thoughts, but I can not find it.... (have a few ideas myself), and
explaining some 'bridges' to cross, and software limitations/work-arounds.

Hey, nice to see and old buddy.

Too bad the scene-downloads where disabled since release of 1.2 and it seems Dimitris has given up on the project. :-/
Well you can download the scene here.
Infinity is vast, especially near end.
bye, Lynxx

Re: One rotational axis on two rectangles' corners? 1 year, 10 months ago #948

GiDay again mate... Got that file.... OH, I see what you are doing, by effectively moving the rotational point of the object(s) 'centres'... However.......
I THINK (?) the question was in regard to the two main shapes still animating RELATIVE to each other, but limited, as in an Elbow joint on your arm ??
Being virtually impossible to replicate 'precisely' as the "real-world" representation would not allow zero spacing from the corners. Especially considering the following !!!! (haha)......
[1] Be careful of using the 'Grid/Snap' for adjoining shapes, as there are no GAPS between objects. The 'Box2D' physics engine behind the scenes creates a small barrier between 'colliding' objects to stop repeated collision-detection, so dynamic objects can NOT stay 'colliding', and so all are moved slightly. (Typically 'about' .02? of a unit).

(??? Hmmm.. seemed to have lost the ability here to show inline images....???)

[2] (Am lost without pics to show hahaha...) so maybe download this 'Scene' file, from
nosilverspoons.info/public_html/ElbowJoint/Joint-Bending-1.scene
to show what I mean, as an alternative....
Link-Here......
nosilverspoons.info/public_html/ElbowJoint/Joint-Bending-1.scene
1x1 square diag = root-2. Cube diag = root-3. Beautiful !
  • Page:
  • 1
Moderators: Glenn555
Time to create page: 0.20 seconds