collision detection of rotating objects

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

collision detection of rotating objects

Postby jiandingzhe » Tue Feb 28, 2012 1:04 am

Hi, everyone!
I'm planning to make my own physics engine. I don't have much experiences about it, then I read a book and found some problems.
While processing with moving objects, to avoid unexpected penetration, the space being swept are used for detection. However, for convex objects, the swept space is convex only when no rotation occurred.
In that book, they said we can treat small things firstly being translated, then being rotated. However, in my application, there are many objects that are thin and long. When they rotate fast without translate, small objects may get through them.

I made a picture to show the situation, attached with post.
rotate_penetration.png
rotate_penetration.png (36.25 KiB) Viewed 2313 times

How to solve that problem? Thanks a lot!
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing

Re: collision detection of rotating objects

Postby Julio Jerez » Tue Feb 28, 2012 9:24 am

are you planning to make a 2d collision system?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: collision detection of rotating objects

Postby jiandingzhe » Tue Feb 28, 2012 10:16 am

Julio Jerez wrote:are you planning to make a 2d collision system?

No, I want to make a 3D system. I just draw my question in 2D for simplicity.
I decide not to use Newton or any other ready-to-use physics engine, because my application will have very large outdoor scene. I want to make a grid of height field, which automatically unloads a tile when no moving object is beyond that tile. Moreover, I want to cope with ten thousands of physical objects, so I will use the power of GPU.
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing

Re: collision detection of rotating objects

Postby Julio Jerez » Tue Feb 28, 2012 11:37 am

jiandingzhe wrote:No, I want to make a 3D system. I just draw my question in 2D for simplicity.
I decide not to use Newton or any other ready-to-use physics engine, because my application will have very large outdoor scene.

That does no soudn liek a good reason for not usin an off the shell library.
Newton or any other engine do support outdoor scene, as a matter of fat physics engien do no make distintion between indorr or outdoor.

Beleive it is a huge mistake to start makin a physics library, or a graphics librar, if you want to make a game.
In general people who make technology libraries has a different set of skill, than than peopel how are motivate to make Games.
You can not simply read a Book, and go an try to implement that thonk that you will get a polish library.
It is a lot more than, that.
It takle many, many year in teh fiel of Mathematics an physics to be ablet to make your own algorithm and to undernat other people algorithm,
and also know when to apply heursitic, of analitical solution.

If you fell teh passion , go for it, you leran a lot in teh proccess, but do not make the mistake of tryi making aqn engine for a Game, because in teh end afte month and moth
of frustration you get neither, just frustration.

It is true using a physics libray you still have to put a lot of work, but there is a big difference betwen Physics modeling, and writing physics algorithm.

The best analogy I can provide to you is the roll ofa technical artish.
Thsi si a person that know how to use the funtionality on lot of reatore in a modeling package, but he is not an artish, and he is no a programmer.
he underand both bot do no excell at both.
I have being doing this for many many years and I am still learning.
jiandingzhe wrote:I want to make a grid of height field, which automatically unloads a tile when no moving object is beyond that tile. Moreover, I want to cope with ten thousands of physical objects, so I will use the power of GPU.

Gird fidl are standard solion gemeoety on every phsyics library.
Many physics libraries do use GPU, Physx one of them.
an with respect of eth many objects, bear in mind that Nvidai is teh make of one of eth most pweful GPU, they has information that teh public does not,
they alsop spend then fo million of dollar every years payn a staff of highlly professnilas to write sophsiticate code usin tha knwoledge.
I do not know why you want to complete with them. you are at extrem disavantage.

Havok has is own by intel, and they two have information we do no have, for example in they treading system they can use low letancy calls
that are no generally asessible to the people because they will risk other poperation of the operating system.
so there can make muticore funtionality better than an ordinary programmer. why woudl yo uane to competer with them?

I teh case of newton I do no compete wit teh in that area, I compelet in my graund with is Matahmatic and physics.
I provide an engien that is competitive with thsoe technology, but is ti no as \fast as theirs because beacus of the disavatage I have compere to them.
Bu newton is the most realistic physic engine and is very competive performance wise, why would you want to compete with me, when I have so much avatage over you now.

you do not have to use Newton, but if you want perfomace above all, you can use havok or Physx,
Newton is open source, you can learn from it, but tehr are oeteh open source solution you can try too. T teh very least you will learan wah no to do in short time than try to invent it yourself.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: collision detection of rotating objects

Postby jiandingzhe » Thu Mar 01, 2012 3:43 am

Julio Jerez wrote:
jiandingzhe wrote:No, I want to make a 3D system. I just draw my question in 2D for simplicity.
I decide not to use Newton or any other ready-to-use physics engine, because my application will have very large outdoor scene.

That does no soudn liek a good reason for not usin an off the shell library.
Newton or any other engine do support outdoor scene, as a matter of fat physics engien do no make distintion between indorr or outdoor.

Beleive it is a huge mistake to start makin a physics library, or a graphics librar, if you want to make a game.
In general people who make technology libraries has a different set of skill, than than peopel how are motivate to make Games.
You can not simply read a Book, and go an try to implement that thonk that you will get a polish library.
It is a lot more than, that.
It takle many, many year in teh fiel of Mathematics an physics to be ablet to make your own algorithm and to undernat other people algorithm,
and also know when to apply heursitic, of analitical solution.

If you fell teh passion , go for it, you leran a lot in teh proccess, but do not make the mistake of tryi making aqn engine for a Game, because in teh end afte month and moth
of frustration you get neither, just frustration.

It is true using a physics libray you still have to put a lot of work, but there is a big difference betwen Physics modeling, and writing physics algorithm.

The best analogy I can provide to you is the roll ofa technical artish.
Thsi si a person that know how to use the funtionality on lot of reatore in a modeling package, but he is not an artish, and he is no a programmer.
he underand both bot do no excell at both.
I have being doing this for many many years and I am still learning.
jiandingzhe wrote:I want to make a grid of height field, which automatically unloads a tile when no moving object is beyond that tile. Moreover, I want to cope with ten thousands of physical objects, so I will use the power of GPU.

Gird fidl are standard solion gemeoety on every phsyics library.
Many physics libraries do use GPU, Physx one of them.
an with respect of eth many objects, bear in mind that Nvidai is teh make of one of eth most pweful GPU, they has information that teh public does not,
they alsop spend then fo million of dollar every years payn a staff of highlly professnilas to write sophsiticate code usin tha knwoledge.
I do not know why you want to complete with them. you are at extrem disavantage.

Havok has is own by intel, and they two have information we do no have, for example in they treading system they can use low letancy calls
that are no generally asessible to the people because they will risk other poperation of the operating system.
so there can make muticore funtionality better than an ordinary programmer. why woudl yo uane to competer with them?

I teh case of newton I do no compete wit teh in that area, I compelet in my graund with is Matahmatic and physics.
I provide an engien that is competitive with thsoe technology, but is ti no as \fast as theirs because beacus of the disavatage I have compere to them.
Bu newton is the most realistic physic engine and is very competive performance wise, why would you want to compete with me, when I have so much avatage over you now.

you do not have to use Newton, but if you want perfomace above all, you can use havok or Physx,
Newton is open source, you can learn from it, but tehr are oeteh open source solution you can try too. T teh very least you will learan wah no to do in short time than try to invent it yourself.

Thanks for your detailed advise.
I neither want to exceed the knowledge of Nvidia, Intel, or you, nor I want to create a engine exceed PhysiX, Havok, Newton, or Bullet. I'm not a computer scientist, even not major in that. It's just my hobby after work. I just want to make my own ugly solution that specifically fits my require, and for fun.

Moreover, in the previous post I did not provide a clear declaration of my problem:

1:
I want to create a outdoor scene with size of ~100x100 kilometers. If the resolution of height field is 20m, it is 5000x5000=25,000,000 points, not including static decorations like trees, stones, or buildings. So I think only some part of the height fields should be loaded in memory.

2:
Single-precision float has 23bits of fraction parts, which is a little more than 7 decimal bits. For 100km and 1m, the scale is 1e5, which is a little bit too near to the precision limit. Maybe I should split the scene into tiles, moving object have their coordinates local to the tile they above. Otherwise I have to use expensive double-precision floats.

3:
For my initial post. I want to make a game somewhat like "Homeworld". In Homeworld ,the engine does not deal with object rotation neatly. When large vessels rotate, sometimes small vessels being squeezed in and get an improper contact force. I don't know current physics engines' behavior on that issue. I just worried about that, and want to create a solution that I know the detail.
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing

Re: collision detection of rotating objects

Postby Julio Jerez » Thu Mar 01, 2012 10:35 am

jiandingzhe wrote:Single-precision float has 23bits of fraction parts, which is a little more than 7 decimal bits. For 100km and 1m, the scale is 1e5, which is a little bit too near to the precision limit. Maybe I should split the scene into tiles, moving object have their coordinates local to the tile they above. Otherwise I have to use expensive double-precision floats.


this is not eassy, streaming and unlimite size shapes is a planned feature of newton 300.
Thsi si a complex problem to solve, both with physic and graphics.
has you solve the issue wi the graphics yet?

Newton solution will be that it will have a funtion that the application will call wit teh camera matrix to get the Segment.
and all objects readt will have a realtive offecet to that origin.

for that object intenally will have a phsicall address, whi will be a large float, and a logical adress whi will be the adress realtive to sole locatopn spcified by the application.
I have no done much there yet, but as sonn I cover the basic feature I will start with that.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: collision detection of rotating objects

Postby jiandingzhe » Thu Mar 01, 2012 9:17 pm

Julio Jerez wrote:this is not eassy, streaming and unlimite size shapes is a planned feature of newton 300.
Thsi si a complex problem to solve, both with physic and graphics.
has you solve the issue wi the graphics yet?

Newton solution will be that it will have a funtion that the application will call wit teh camera matrix to get the Segment.
and all objects readt will have a realtive offecet to that origin.

for that object intenally will have a phsicall address, whi will be a large float, and a logical adress whi will be the adress realtive to sole locatopn spcified by the application.
I have no done much there yet, but as sonn I cover the basic feature I will start with that.

For graphics part, I have not decided. I don't know OGRE's tiled terrain system could handle the loss of float precision. Maybe I could make OGRE compiled with double precision, which is enough. At least, I could implement my own ugly graphics engine (actually I've already made one, very ugly).

In my imagine, the tiled physics system might like this: objects only has local coordinate to the tile inside, and there are no explicit global coordinates. Objects are never larger than a grid, so it will only cross neighbor grids. When an object's origin leaves a grid, its coordinate switches to the neighbor grid. A grid is loaded when something enter it, and deleted when no objects exist in it and its neighbors.
User avatar
jiandingzhe
 
Posts: 48
Joined: Fri Jul 08, 2011 11:21 am
Location: Beijing


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest