Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (dr_panther, AndrewAMD, Ayumi, TedMar), 1,033 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Magnets #32680
09/02/04 11:04
09/02/04 11:04
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan


I want to have a magnetic rotating cylinder that balls will stick to when they get close. Does anyone have any ideas how to attack this?

Re: Magnets [Re: A.Russell] #32681
09/02/04 12:11
09/02/04 12:11
Joined: May 2002
Posts: 757
NY, USA
GhostDude Offline
Developer
GhostDude  Offline
Developer

Joined: May 2002
Posts: 757
NY, USA
You could use a scan_entity() to determine if an attractable object is close, then use phent_addcentralforce or something like that to move the object.


Lead Programmer of Realspawn Productions AIM: gh0s7mp630 MSN: [Email]"mpratt630@hotmail.com"[/Email]
Re: Magnets [Re: GhostDude] #32682
09/02/04 13:23
09/02/04 13:23
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Another option might be to use the ph_slider. When the ball comes close to the magnet, you attach the constraint. You can then adjust the motor 1 parameter to simulate attraction and rejection and release the constraint when it goes outta range. The manual says that other movement is blocked so this might not work for the kind of magnetic motion you want.

Re: Magnets [Re: fastlane69] #32683
09/02/04 13:32
09/02/04 13:32
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan


How about if I change the ball's gravity to the centre of the cylinder when it comes within range?

I'm not sure how then it would rotate with the cylinder, though.

Re: Magnets [Re: A.Russell] #32684
09/02/04 21:21
09/02/04 21:21
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
No, that wouldn't work. Gravity is global. I'll your suggestions. Thanks.

Re: Magnets [Re: A.Russell] #32685
09/03/04 00:11
09/03/04 00:11
Joined: Oct 2000
Posts: 1,543
Germany
A
Alexander Esslinger Offline
Senior Developer
Alexander Esslinger  Offline
Senior Developer
A

Joined: Oct 2000
Posts: 1,543
Germany
Not sure how a "magnetic rotating cylinder" looks like or works, but if you know how it works, you can add the corresponding forces to your ball-objects via add_force().

Re: Magnets [Re: A.Russell] #32686
09/04/04 05:47
09/04/04 05:47
Joined: Jan 2003
Posts: 748
California
BHoltzman Offline
Developer
BHoltzman  Offline
Developer

Joined: Jan 2003
Posts: 748
California
If you don't need this to be interactive then it's very easy to set up an animation of the balls sticking to a magnetic cylinder. You can even use hook's law so the balls can build a chain that is effected by inertia and other forces you may want to introduce. Also the balls would be able to detect self collisions so they won't go through each other.

If this needs to be interactive then I don't know how to solve it. The latest beta messes up physics on my computer. But it's got some important physics functions like the iteration control and the physics auto off feature. I know I messed up the names but I'm hoping you know what I'm talking about.

Anywho, it's probably worth while to wait for these functions to work in the physics system.


I'm not Mr Franklin but I am Benjamin. My avatar partly suites me.
Re: Magnets [Re: BHoltzman] #32687
09/04/04 12:07
09/04/04 12:07
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan

I'm going for the interactive approach. Here's a simple illustration to help explain the effect:



I'm also still using 6.22.

I'd like to learn more about "hooks law". How does that work?

Re: Magnets [Re: A.Russell] #32688
09/04/04 14:04
09/04/04 14:04
Joined: Jan 2003
Posts: 748
California
BHoltzman Offline
Developer
BHoltzman  Offline
Developer

Joined: Jan 2003
Posts: 748
California
Sure, Hooks law is a rule for particle simulation that makes the particles reach out from or away from a goal by hooking particles onto each other. It looks like how a strong magnetic field makes a series of metal objects stick to each other. It's a cool effect to watch. I'm only familiar with it through XSI. But if you're thinking of trying to simulate it interactively, I'm not sure how to help you.

I'll look for information on the technical aspect of it if you're interested. Or if you'd like me to email you an animation of hook's law in action, I can do that for you too.

EDIT: I did a google search and found a simple physics example showing Hook's law. It doesn't look terribly complicated. You take a look and see what you think.

http://www.suremath.com/suremath/suremath/kinDir/springW.html

Last edited by BHoltzman; 09/04/04 14:27.

I'm not Mr Franklin but I am Benjamin. My avatar partly suites me.
Re: Magnets [Re: BHoltzman] #32689
09/05/04 17:53
09/05/04 17:53
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Gosh, that's very complicated. It would be like writing an extention for the physics engine. I was hoping for something simpler, like a local gravity using the curent physics engine, though it doesn't seem possible.

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1