Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
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
2 registered members (AndrewAMD, Quad), 755 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 5 1 2 3 4 5
Re: ball physics #15964
08/03/03 08:51
08/03/03 08:51
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
a) Because I can

b) Because I honestly thought you were showcasing your work, not asking any questions.

c) See a)

Harassing and Annoying...that's the polices job, not mine.

Re: ball physics #15965
08/03/03 09:13
08/03/03 09:13
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline OP
Member
Jason Bryant  Offline OP
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
Here is the player input code.. that includes the jump as well..
code:
 
//----------------------Player Input-------------------------------------
function playerInput()
{
// this function is called every frame from player player action
// reset the force vector each frame
force.x = 0;
force.y = 0;
force.z = 0;

//allow control of ball if on the ground...
if (ground_dist > 0 && ground_dist < scale_dist)
{
if(key_cuu)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
vec_normalize(force,power); //force vector points from camera to player at length of power
}
if (key_cud)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
vec_inverse(force);
vec_normalize(force,power);
}
if(key_cul)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
force_ang.pan = 90;
vec_rotate(force,force_ang);
vec_normalize(force,power);
}
if(key_cur)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
force_ang.pan = -90;
vec_rotate(force,force_ang);
vec_normalize(force,power);
}
}
// add flying force here....
if(mouse_right)
{
//activate current powerup here...
//will use mousewheel to cycle powerups
force.z = glide_power;
//to allow control while flying
if(key_cuu)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
vec_normalize(force,power); //force vector points from camera to player at length of power
}
if (key_cud)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
vec_inverse(force);
vec_normalize(force,power);
}
if(key_cul)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
force_ang.pan = 90;
vec_rotate(force,force_ang);
vec_normalize(force,power);
}
if(key_cur)
{
vec_set(temp.x,camera.x);
temp.z = player.z;
vec_diff(force.x,player.x,temp.x);
force_ang.pan = -90;
vec_rotate(force,force_ang);
vec_normalize(force,power);
}
}

//jumping...
if(mouse_left)
{
// only allow jump if on ground, not in air
if (ground_dist > 0 && ground_dist < scale_dist)
{
jumping = 4;
while(jumping>0)
{
// play jump sound here
snd_play(boing,sound_vol,0);
force.z = jump_power;
jumping-=1;
wait(1);
}
}
}
//force vector now contains player intention forces
}

Jason

Re: ball physics #15966
08/03/03 09:39
08/03/03 09:39
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i think the problem is that the corrections per frame are less than the movement caused by the force applied to your ball. try to reduce the weight of the ball and the forces applied to it! or increase the corrections (ph_setcorrections)... or do both, just experiment with all these values a little...

Re: ball physics #15967
08/03/03 16:58
08/03/03 16:58

A
Anonymous
Unregistered
Anonymous
Unregistered
A



quote:
Originally posted by fastlane69:
a) Because I can

b) Because I honestly thought you were showcasing your work, not asking any questions.

c) See a)

Harassing and Annoying...that's the polices job, not mine.

Get a life dude, damn....

Re: ball physics #15968
08/04/03 07:41
08/04/03 07:41
Joined: Jul 2000
Posts: 11,321
Virginia, USA
Dan Silverman Offline
Senior Expert
Dan Silverman  Offline
Senior Expert

Joined: Jul 2000
Posts: 11,321
Virginia, USA
fastlane69,

Let the moderators determine which posts are off topic and which ones are not. Also, there is no need to be insulting in your posts. The better course of action would have been to have said nothing. At least Ventilator was trying to be helpful. You could have done the same.


Professional 2D, 3D and Real-Time 3D Content Creation:
HyperGraph Studios
Re: ball physics #15969
08/03/03 20:47
08/03/03 20:47
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline OP
Member
Jason Bryant  Offline OP
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
This is the physics setup of the ball. I'm only using a mass of 5. (normal_friction = 50 and normal_damping = 60 currently)

code:
 
phent_settype(my,PH_RIGID,PH_SPHERE);
phent_setgroup(my,2);
phent_setmass(my,5,PH_SPHERE);
phent_setfriction(my,normal_friction);
phent_setelasticity(my,50,40);
phent_setdamping(my,normal_damping,normal_damping);
player=my;

I'm using ph_setcorrections(20000,0.1);

I will set it up so that I can adjust these values on the fly and see if that helps. Thanks for the tips.

Jason

Re: ball physics #15970
08/04/03 05:39
08/04/03 05:39
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Please see "forum wide apology" on "morbius foreign affairs" for a response to my recent attitudes.

Peace out.

Re: ball physics #15971
08/04/03 07:57
08/04/03 07:57
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i did some experiments and found out that ph_setcorrections(60000,0.01); reduces the problem to a minimum (i only succeeded in penetrating the walls if i really tried hard). you should definitely do some traces and stop applying a force when the ball tries to move against a wall.

and that the ball starts spinning at all is really strange we should ask marco about why this can happen because it's quite unrealistic...

Re: ball physics #15972
08/04/03 16:41
08/04/03 16:41
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
marble.zip -> my experiments - you can look into the wdl to see how i did it. i used phent_addtorqueglobal to move the ball because i think it's cooler when the ball slips a little. controls: wasd, right mouse button + scroll wheel to control the camera

are you able to let the sphere fall through the level? i still can do it but only because i know where and how...

it seems to work somewhat better with the current beta because there i could limit the rotation speed. with 6.00.6 i had to disable this part because there is a bug in phent_getvelocity. but even in the beta i can let the sphere fall through the level...

Re: ball physics #15973
08/04/03 22:33
08/04/03 22:33
Joined: Apr 2003
Posts: 111
france
seb_dup1 Offline
Member
seb_dup1  Offline
Member

Joined: Apr 2003
Posts: 111
france
Ventilator
Under the square pipe , the ball get stuck ..He he
Not enough force?
[Smile]

Page 2 of 5 1 2 3 4 5

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