Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 1,012 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
poly collision and moving objects, How to? #67628
03/21/06 23:10
03/21/06 23:10
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline OP
Serious User
BlueBeast  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
How does one make this work...? Lets say you have a street, and lets say you have a ball rolling into the street. Every couple of seconds, a car drives by. The ball is a model with, like 500 polygons. How do you make poly collision work with hitting the car (or the car hitting the ball?)

You see, if a model is moving by script, and that model has my_polygon=on, it's still not accurate collision when they collide.

I've tried a block entity (like with doors), and ive tried a model.
I cant find a way to make a moving object that the ball will react to accuaratly. The ball does get hit, and will bounce away, but the point of impact seems arbitrary, and definately is not accurate to the moving object's TRUE shape.

A static block or model is accurate when the ball hits it. But moving an object acts differently.

I'm still using PRO 6.31.4 not the update. I'm sure there is a way, but how?

Thanks!

Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: poly collision and moving objects, How to? [Re: BlueBeast] #67629
03/23/06 01:18
03/23/06 01:18
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline OP
Serious User
BlueBeast  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
*bump* Did I stump the forums with this? Or is this in the wrong thread?


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: poly collision and moving objects, How to? [Re: BlueBeast] #67630
03/23/06 11:21
03/23/06 11:21
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
Hi there,
can you show us some pieces of your code? especially the part with your physic definitions...
what kind of collision detection are you using?

phent_settype(player, ph_rigid, ph_poly);?

are all your moving objects physic entities?

cheers

Zwecklos

Re: poly collision and moving objects, How to? [Re: zwecklos] #67631
03/23/06 13:41
03/23/06 13:41
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline OP
Serious User
BlueBeast  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
Thats a good question, because i didnt write the code No, um the ball is using this.... (and other code, of course.....)

phent_settype(my, PH_RIGID, PH_sphere);
ph_setgravity ( earthgravity );
phent_setmass(my, 8, PH_sphere);

All I have right now is a ball i can move around.... all other level objects are either blocks,
or
models that have my_polygon = on

I guess i just want to know what it will take to make the collision between the ball and a moving object work right.

Collision with static models works great, it's the moving ones that act funny.


Another example would be to picture a mini golf game. The windmill would have the blades that rotate, if you make it through, great, but the fan blades would have to be able to accurately stop and/or push away the ball. And the blades would be thin and narrow, so accuracy with collision would be a must.



Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: poly collision and moving objects, How to? [Re: BlueBeast] #67632
03/23/06 21:35
03/23/06 21:35
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
ok at this point we need to know if the moving objects are physic entities.

If they arnt, we need to know if they are moved trough an ent_move or a c_move instruction.

an entity will have a polygon based bounding box when you are using c_move.

for your example, I would make the windmills (the rotaing things) in seperate models. In this way you wont run in any bounding box troubles.
move them with a code like this:

Code:

windmill_1.x = windmill_middle.x - cos(windmill_middle.pan) * radius;
windmill_1.y = windmill_middle.y - sin(windmill_middle.pan) * radius;
windmill_1.z = windmill_middle.z + sin (tilt_3rd) * radius;



This Code is only a pointer in the right direction. You have to re-do the trigonometry for your purpose.

I hope this helps

cheers

Zwecklos

Re: poly collision and moving objects, How to? [Re: BlueBeast] #67633
03/24/06 14:04
03/24/06 14:04
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline
Expert
A.Russell  Offline
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
3DGS physics is ODE, and seems to still use its own collision system. You'd have to ask Marco to be sure, but I know that the physics system is not 100% compatible with the 3DGS collision system.

That being the case, you might be better to make your windmill blades physics objects as well.

Slap me around if I'm wrong, Marco.


The other thing is as zwecklos says, poly collision might not be working very well in the version you are using. Your best bet in that case would be to make the windmill blades as map entities. With the latest version, poly collsion is pretty good, though.

Also, you must use a sky box.



Last edited by A.Russell; 03/24/06 14:11.
Re: poly collision and moving objects, How to? [Re: A.Russell] #67634
03/24/06 21:22
03/24/06 21:22
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline OP
Serious User
BlueBeast  Offline OP
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
Thanks for the input everyone, right now i have the skybox, well, theres a hollow box around my level.
I've done some extensive testing with a ball and it's action/reaction to poly collision on static models, terrain, and blocks with this version... (some of you were witness to my 'other' project) and I think the collision is admirable.

This, of course, only aplies to static objects. as far as moving objects, the sccuracy is not there. I want to get a litle more done with other aspects of the game before updating. Updates in the middle of a project can be no fun expecially when interfaces change!

But I'll have to try the updated collision and then physics suggestions as needed. Thanks for pointing me in the right direction!


Jason


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com

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