Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Nymphodora), 490 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 1
Page 1 of 2 1 2
PLEASE HELP FAST! Need help with A6 physics #37534
12/10/04 02:56
12/10/04 02:56
Joined: Sep 2003
Posts: 489
Switzerland
Dragon Offline OP
Senior Member
Dragon  Offline OP
Senior Member

Joined: Sep 2003
Posts: 489
Switzerland
Can someine tell me how I can make a ball wich I can change the direction with the arrow buttons, but it's not supposed to roll back up a hill unless it has enough speed.
Thanks

Last edited by Dragon; 12/11/04 03:41.

Re: Ball steering Physics [Re: Dragon] #37535
12/10/04 15:26
12/10/04 15:26
Joined: Dec 2002
Posts: 1,866
B
b_102373 Offline
Senior Developer
b_102373  Offline
Senior Developer
B

Joined: Dec 2002
Posts: 1,866
Try the Newton Physics engine. Download the free 30mb download with the example games and documentation and there is a small demo exactly what you want. I think its called "Water".

Newton Physics Engine

Re: Ball steering Physics [Re: b_102373] #37536
12/10/04 20:24
12/10/04 20:24
Joined: Sep 2003
Posts: 489
Switzerland
Dragon Offline OP
Senior Member
Dragon  Offline OP
Senior Member

Joined: Sep 2003
Posts: 489
Switzerland
I would like to do it with 3dgs
But thanks anyway


Re: Ball steering Physics [Re: Dragon] #37537
12/11/04 05:03
12/11/04 05:03
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
Unless somebody is working on the exact same project and wants to give you all his code (unlikely ) we are going to need more details from you.

Tell us what you've done so far, what isn't working, etc. Right now we got nothing to go on.


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI
Re: Ball steering Physics [Re: Doug] #37538
12/11/04 05:13
12/11/04 05:13
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
What you'll want to do is call phent_settype and the other setup functions (phent_setmass, damping, etc)- see AUM for examples. Then you'll need a while loop where the keys are checked and phent_addforceglobal is called to push the sphere around. You might find some code snippets by searching in this forum.

Re: Ball steering Physics [Re: Doug] #37539
12/11/04 05:16
12/11/04 05:16
Joined: Sep 2003
Posts: 489
Switzerland
Dragon Offline OP
Senior Member
Dragon  Offline OP
Senior Member

Joined: Sep 2003
Posts: 489
Switzerland
ok, thanks
What I need is a simple physics code with wich I can simply control the pan of a Physics entity and I don't want a ball to roll back up a hill, or go forward without force from a downhill roll.


Re: Ball steering Physics [Re: Dragon] #37540
12/11/04 05:21
12/11/04 05:21
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
To control the pan, you will need to add an angular force. To do this, you use phent_addcentralforce with a veclocal off center. This will apply an off center force and effectively rotate (ie change the pan) of your ball.

Regarding your requirements that the ball not roll unless it's on a hill (Guessing something like Marble Madness perhaps? ), then as long as gravity is set within the Physics Engine, this is exactly what will happen.

Re: Ball steering Physics [Re: fastlane69] #37541
12/11/04 06:15
12/11/04 06:15
Joined: Sep 2003
Posts: 489
Switzerland
Dragon Offline OP
Senior Member
Dragon  Offline OP
Senior Member

Joined: Sep 2003
Posts: 489
Switzerland
Yes, It was called Marble maddnes
This is my code I'm using:

Code:
 
action ball
{
p_player=my;
my.shadow=on;
phent_settype(my,PH_RIGID,PH_SPHERE);
phent_setmass(my,5,PH_SPHERE);
phent_setfriction(my,40);
phent_setelasticity(my,40,10);
phent_setdamping(my,20,20);
var dir[3];
while(1)
{
vec_set(dir,nullvector);
if(key_a)
{
dir.x-=1;
}
if(key_d)
{
dir.x+=1;
}
if(key_w)
{
dir.y+=1;
}
if(key_s)
{
dir.y-=1;
}
vec_rotate(dir,vector(camera.pan,0,0));
vec_normalize(dir,80*time);
phent_addtorqueglobal(my,dir);
wait(1);
}
}

function initialize_physics
{
ph_setgravity(vector(0,0,-380));
ph_setcorrections(20000,0.1); //60000 0.01
}



function main()

{
initialize_physics();
load_level("lvl1.wmb");
}



But with that the ball rolls back up the hill. Where do I change that?


Re: Ball steering Physics [Re: Dragon] #37542
12/11/04 06:36
12/11/04 06:36
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Try decreasing torque or increasing gravity.

Re: Ball steering Physics [Re: Marco_Grubert] #37543
12/11/04 20:17
12/11/04 20:17
Joined: Sep 2003
Posts: 489
Switzerland
Dragon Offline OP
Senior Member
Dragon  Offline OP
Senior Member

Joined: Sep 2003
Posts: 489
Switzerland
No, that doesn't work
I tryed both.


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