Bounding Boxes and irregular shapes

Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Bounding Boxes and irregular shapes
PostPosted: Thu Dec 27, 2007 11:15 am 
User avatar
Blistered

Current Scorched3D Rank: Unranked



Joined: Thu Dec 20, 2007 7:01 am
Posts: 39
Location: Germany
Landscapes are mostly made of . . err . . well . . ground. But ground can only stay at the same width or get narrower with altitude. You can't have a mountain with holes in it, or negative slopes. I found this a bit limited and started building landscapes with models. Obviously it doesn't make sense to define those objects as models, since they'd be gone when hit. The only way to make them stay, is to define them as targets and give them enough life to survive a round. A few other tags are needed, so they don't get destroyed when driven over, drop, etc. pp.
(A bridge that evaporates when being used, doesn't make much sense)
A new object type for structures would make things easier.
(Since they don't use any accessories, this should be a snap.)
The other trouble is, that we only have bounding boxes or spheres. If a model is much narrower at the top or base, (i.e. a pyramid, or a cone) the existing boundaries are of no use. A projectile will collide with a pyramid/cone if it hits an area inside it's XYH coordinates. The existing boundaries don't care that those objects have a pointed top.
And: Containers have solid walls, you could never shoot through a hole.
All you can do is apply a nocollissions tag.

I think we need more coordinates, ie X,Y for the base and X2,Y2 for the top.
How about an outer/inner sphere/cube to define whats solid and what's not ?
It'd be best if we could define the boundaries for each model.
The very simple boundaries for a pyramid could look like this.

objecttype='structure')
modeltype='MilkShape'>path/to/*.txt</model>
<BoundingBox> <X>4</X><Y>4</Y><W>4</W><H>4</H><X2>1</X2><Y2>1</Y2>
</BoundingBox>
</object>

Or with even more coordinates for polygons . . . :twisted:

( This is supposed to be in English, I hope it's understandable . . :) )

Just in case you can't figure what I'm goin on about . .

Here's our scene:

Image

Here's where I aim:
The shot should pass at 50% height

Image

And here's where the missile bursts:

Image

If you're close enough, it's impossible to shoot over the pyramid coz it's boundaries are at a 90° angle.
Of course there's the nocollission tag, but what's the point of having a 900ft wall in front of your nose, and being able to shoot right through it ?


Last edited by Pam on Thu Dec 27, 2007 5:14 pm, edited 4 times in total.

Top
 Profile  
 
 Post subject: Re: Bounding Boxes and irregular shapes
PostPosted: Thu Dec 27, 2007 1:32 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked




Joined: Wed Aug 15, 2007 11:20 am
Posts: 1786
Location: Temporarily assigned to northern Afrika
Hi Pam:

I hope you enjoyed my reply to your previous post and that you did a little experimenting with what I suggested. It appeared that you had abandoned the topic so I decided to try a few things and had some very nice results, thanks for sharing your ideas.

Pam wrote:
Landscapes are mostly made of . . err . . well . . ground. But ground can only stay at the same width or get narrower with altitude. You can't have a mountain with holes in it, or negative slopes. I found this a bit limited and started building landscapes with models. Obviously it doesn't make sense to define those objects as models, since they'd be gone when hit. The only way to make them stay, is to define them as targets and give them enough life to survive a round. A new (indestructible) object class would make things easier.


Adding sufficient life (10K) is of little help if the blast destroys the ground underneath. You can however, make your landscape objects taller and place them directly on the sea floor. This will prevent your objects from falling when hit. It doesn't address the bounding box any of the other issues with objects but it might work ok for altering the appearance of the landscape, or creating small immovable firing obstacles for now. I'm sorry the pyramid isn't working out the way you had hoped but I "think outside the box." :shock:

The only down and dirty fix I can think up for you at the moment would be stacked objects. Considering the size of the base on your pryamid I seriously doubt that you'd need to place it on the seabed. The pyramid itself would then be a series of rectangular blocks that get smaller towards the top. Each block would have it's own bounding box and would give you a way to overcome the restiction you are having now. This also gives you a means of making a hole, a tunnel or a hideout, if properly implemented. :wink:

Pam wrote:
The other trouble is, that we only have bounding boxes or spheres. If a model is much narrower at the top or base, (i.e. a pyramid, or a cone) the existing boundaries are of no use. A projectile will collide with a pyramid/cone if it hits an area inside it's XYH coordinates. The existing boundaries don't care that those objects have a pointed top.


About the bounding box, I agree, a bounding box and a shield that follow the contour of the object would be ideal.

Pam wrote:
What we need is more coordinates .
It would be nice if we could define the boundaries for each model with a tag.
A tag for a pyramid could look like this.
objecttype="structure")
modeltype="MilkShape" >path/to/*.txt</model>
BoundingBox> <X>4</X><Y>4</Y><W>4</W><H>4</H><X2>1</X2><Y2>1</Y2>
</object>

Or with even more coordinates for polygons . . . :twisted:


How about this instead:

Modifying the core would be required regardless of which option is persued. The model data contains all of the coordinates required. A one time operation on the core to handle this wouldn't clutter up the external files with extra tags and data. This would allow dedicated developers, such as yourself, to concentrate more on the polish and less on the transmission.

The following seems to work fine for the shield issue and requires no excessive code modifications:

Code:
If Weapon will impact target object.
     Check for shield.
          If type = round (detonate here).
          If type = square (detonate here).
          If type  = object (detonate upon bounding box impact).
          If type = none (denotate upon bounding box impact).
     Calculate Damage as before based on type and strength of the shield.


Although the bounding box calculations would require more extensive coding, the object type shield appears very easy to implement. I suspect that implementing more tags would prove to be a much less effective method than simply altering the bounding box code to follow the model contours instead of the maximum X,Y and Z dimensions.

Pam wrote:
( This is supposed to be in English, I hope it's understandable . . :) )


Very understandable.

Good Luck and Best wishes,

Rommel
Nothing gives one person so much advantage over another as to remain
always cool and unruffled under all circumstances. - Thomas Jefferson

You can discover more about a person in an hour of play
than in a year of conversation. - Plato


Last edited by Rommel on Thu Dec 27, 2007 2:11 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 1:47 pm 
User avatar
Blistered

Current Scorched3D Rank: Unranked



Joined: Thu Dec 20, 2007 7:01 am
Posts: 39
Location: Germany
Damn, you are a quick with replies.
I hit the submit button too early, read it again. :P

As for your answer in the other tread.
I'm well aware what a AH64 is, I just wanted to tease an individual that hasn't talked to me yet, but gives orders for banning me "on sight" because someone "thinks" I'm doing/having "something".
Obviously he's not man (boy) enough to reply . .
Anyway,
about the landscapes:
As of now there is only one bordertype: Water.
It's not difficult to create a new type, i.e. ground.
I found that the idea of different weapon loads for different tanks is already implied in tanktypes.xml.
There's a tag called <disableaccessory>, but afaik it's not been used yet.
I'll give it a try.


Last edited by Pam on Thu Dec 27, 2007 2:18 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: Bounding Boxes and irregular shapes
PostPosted: Thu Dec 27, 2007 1:55 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Wed Jun 14, 2006 11:18 pm
Posts: 1480
Location: United Kingdom
Nice idea with placing the models at zero height, Rom. I hadn't considered that.


Pam wrote:
...a mountain with holes in it, or negative slopes. I found this a bit limited and started building landscapes with models

If you don't eat yer meat, you can't have any pudding.

Looks good. Well done.

How could you implement negative slopes with 2D height maps? I can maybe think of a couple of ways you could do it in theory. Wouldn't be easy though.

Certainly would change everything to have that kind of control over the landscape. Maybe if we had the option of VRML landscape files?

I think someone else was talking about modelled bridges etc that you can walk on. I think it would be nice to set models as 'landscape type' so they're made out of ground. Could that work?


Ps:
You could do a pyramid with a height map. There's a 3d editor, top orthographic method.

And you could texture the pyramid with an object ground map, you don’t necessarily need to rely on the rockside texture.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 2:04 pm 
User avatar
Blistered

Current Scorched3D Rank: Unranked



Joined: Thu Dec 20, 2007 7:01 am
Posts: 39
Location: Germany
I did the pyras with height maps.
All you need is 4 triangles with the same gradient, but the texture looks lousy.
The textures are wrapped around in a strange way, they have different angles on every side.
I just took pyramids to make it easy to understand what I'm up to.
Right now I'm modeling the Eiffel tower, the Atomium of Bruxelles is already finished.
AND THAT'S where the hightmaps crumble. :P


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 2:31 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked




Joined: Wed Aug 15, 2007 11:20 am
Posts: 1786
Location: Temporarily assigned to northern Afrika
Ok, the pyramid was just an example.
Pam wrote:
I did the pyras with height maps.
All you need is 4 triangles with the same gradient, but the texture looks lousy.
The textures are wrapped around in a strange way, they have different angles on every side.
I just took pyramids to make it easy to understand what I'm up to.
Right now I'm modeling the Eiffel tower, the Atomium of Bruxelles is already finished.
AND THAT'S where the hightmaps crumble. :P
You can still implement your models in several peices. The Eiffel Tower legs would be 4 seperate models. This would allow you to shoot though, drive through, etc. The first level could be a seperate object as well, and continue to the top using the stacking technique. A bit more work for you to model and assemble I know, but it is possible to do many things that at first glance appear impossible given a different perspective. I'm always good for a "different" perspective. On the tower, you might want to extend the legs to the sea bed unless they are sitting on large (seperate items) pedestals (piedestals). Not that it matters really, only one foot is required to remain undisturbed for the tower to remain undisturbed. :wink: Objects that obey the laws of physics? I'm a little too far out of my box as it is now. I'm going to return to working on my mod now.

I wish you great success.

Sincerely,

Rommel

P.S. Are we starting a new fad? Sorry, I can't change my signature just yet. It's a signal that I haven't given up on Apoc Champions returning from the ashes.

You run and you run to catch up with the sun but it's sinking.
Nothing gives one person so much advantage over another as to remain
always cool and unruffled under all circumstances. - Thomas Jefferson

You can discover more about a person in an hour of play
than in a year of conversation. - Plato


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 28, 2007 10:29 pm 
Blistered
Not Signed Up For Stats

Joined: Fri Dec 07, 2007 4:19 am
Posts: 32
what a great looking map!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 29, 2007 5:58 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Looks great. Totaly agree, you basically want some sort of option that uses the actual model shape for the coliision detection. I'll add it to the list :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 10, 2008 4:37 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
gcamp wrote:
Looks great. Totaly agree, you basically want some sort of option that uses the actual model shape for the coliision detection. I'll add it to the list :)

Ooo, that sounds yummy :)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 12, 2008 8:54 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
Just a comment on the part about being able to use a bridge and "drive" over it: This can be done currently, in a roundabout way (but you won't be able to go under it).

I did the following for the wharf on scavenger: Raised the heightmap in the area that the wharf is placed on higher than the wharf will be, then used the flattenarea tag to have it push the visible ground down lower than the wharf. When you use the flattenarea tag, the ground is lowered for rendering, but not for physics calculations. It took some tinkering to get it such that the model of the wharf was just a hair below the original level of the ground. The end result was giving the appearance that the wharf model was the ground, and you could place models on it, drive on it, etc.
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group