Inverted normals for collision?
by Mitovo · in Torque Game Engine · 07/29/2004 (6:29 am) · 10 replies
Hello all,
Quick question here..
I'm trying to figure out ways to make tunnels and otherwise interior/cave-like spaces in a 3D modeler that can than be imported and used for caves and the such.
Now, I've already experimented with setting up separate collision boxes to surround the tunnel/cave, and that works well enough, however, it's rather unwieldy and is an awful over-use of collision meshes.
I'm wondering if it's possible to invert the normals on a mesh and then use *that* for collision? This way the collision surfaces are actually facing the right way and only 1 mesh can be used in place of, say 4 or more with their normals oriented outward?
I'm not at my PC right now, else I'd try it myself...
Thanks for any help on this!
Mike
Quick question here..
I'm trying to figure out ways to make tunnels and otherwise interior/cave-like spaces in a 3D modeler that can than be imported and used for caves and the such.
Now, I've already experimented with setting up separate collision boxes to surround the tunnel/cave, and that works well enough, however, it's rather unwieldy and is an awful over-use of collision meshes.
I'm wondering if it's possible to invert the normals on a mesh and then use *that* for collision? This way the collision surfaces are actually facing the right way and only 1 mesh can be used in place of, say 4 or more with their normals oriented outward?
I'm not at my PC right now, else I'd try it myself...
Thanks for any help on this!
Mike
About the author
#2
I'm looking to create caves/tunnels with DTS format geometry, thus my question about inverted normals...
Now.. if there's an efficient way to create such natural geometry and convert it to DIF format somehow that'd be great.. But as far as I know, it's not possible.
07/29/2004 (7:03 am)
I've considered that option, but creating something organic or natural-looking as a cave using BSP geometry is a pain in rear and not as flexible as DTS geometry.I'm looking to create caves/tunnels with DTS format geometry, thus my question about inverted normals...
Now.. if there's an efficient way to create such natural geometry and convert it to DIF format somehow that'd be great.. But as far as I know, it's not possible.
#4
I am familiar with Nem's actually.. I've used it with other, pure BSP-centric engines in the past (I used to use Reality Factory; nifty package.. really eager to see what they do with 2.0; but I digress...)
Anyway... that actually would work for some circumstances... large caves or small alcoves come to mind. But it still doesn't really provide the amount of fine-detail I'm looking for.. Only DTS-format models would provide that, which is why I'm curious about the inverted normals possibly working for collision meshes... Which.. actually just brought up another thought. Does a collision mesh have to be enclosed? Or can it be, say, a tube with the endcaps missing? It'd be kinda hard to enter and/or exit something like a tunnel when there are invisible barriers stopping you...
Anyone have any insight on this?
Thanks!
Mike
07/29/2004 (8:44 am)
Thanks for the link, Erik!I am familiar with Nem's actually.. I've used it with other, pure BSP-centric engines in the past (I used to use Reality Factory; nifty package.. really eager to see what they do with 2.0; but I digress...)
Anyway... that actually would work for some circumstances... large caves or small alcoves come to mind. But it still doesn't really provide the amount of fine-detail I'm looking for.. Only DTS-format models would provide that, which is why I'm curious about the inverted normals possibly working for collision meshes... Which.. actually just brought up another thought. Does a collision mesh have to be enclosed? Or can it be, say, a tube with the endcaps missing? It'd be kinda hard to enter and/or exit something like a tunnel when there are invisible barriers stopping you...
Anyone have any insight on this?
Thanks!
Mike
#5
07/29/2004 (10:42 am)
I would recomment using DTS format skins or static detail meshes over DIF collision meshes, if you really need DTS-detail. The other option would be to check out Matt Fairfax's 3ds code.
#6
If the models aren't extruding too far past the difs, or mainly above the players reach, then collision should work/look good.
07/29/2004 (10:46 am)
Hmm, that might actually work well. Make the best cave you can with Nems tool, and here/there paste model 'stone outcroppings' of higher detail.If the models aren't extruding too far past the difs, or mainly above the players reach, then collision should work/look good.
#7
But there are some specific situations that would be a little tricker.. such as burrowed holes extending out from the tunnel/cave that smaller creatures might have created.. That kind of thing would be created with Nems... the best I could think of is to create a sort of "crater-like" shape that would overlay a surface and simulate that.
I guess I'll play with that and see what I can come up with...
Are there any plans, or perhaps code mods for TGE that free up the limitations on DTS where collision is concerned? Perhaps allowing more arbitrary objects to be used for collision, instead of just cubes or cylinders?
Thanks again!
Mike
07/29/2004 (12:18 pm)
Hmm... I guess that would work for alot of what I might need to do..But there are some specific situations that would be a little tricker.. such as burrowed holes extending out from the tunnel/cave that smaller creatures might have created.. That kind of thing would be created with Nems... the best I could think of is to create a sort of "crater-like" shape that would overlay a surface and simulate that.
I guess I'll play with that and see what I can come up with...
Are there any plans, or perhaps code mods for TGE that free up the limitations on DTS where collision is concerned? Perhaps allowing more arbitrary objects to be used for collision, instead of just cubes or cylinders?
Thanks again!
Mike
#8
Sure, sometimes Torque's limitations are annoying, but from a programmer's stand point, I can see why they were included. Of course, the generate state of 3D acceleration has changed a lot over the years, but the basis for col-det hasn't (despite just faster processors in general).
I'd say the DIF method is probably the best. I haven't actually experimented yet with it, but I see no reason why it wouldn't. The only immediate concern I see would be transitioning from inside the cave to out -- There's empty squares, but they aren't always guaranteed to be empty. :)
07/29/2004 (5:37 pm)
Michael: You can already use meshes in col-det -- They just have to be convex, and the simpler they are, the faster things go. So it's not entirely arbitary, but doing poly-to-poly intersection tests are expensive. I mean, if I have ten models onscreen at once (a very conservative number), and they are around 1000-3000 polys each, that's a lot of crunching. Sure, you can optimize some if it away with smart algorithms, or avoid some of the processing with bins (aka scene bounding volumes), but that's still a lot of polys to check against every frame.Sure, sometimes Torque's limitations are annoying, but from a programmer's stand point, I can see why they were included. Of course, the generate state of 3D acceleration has changed a lot over the years, but the basis for col-det hasn't (despite just faster processors in general).
I'd say the DIF method is probably the best. I haven't actually experimented yet with it, but I see no reason why it wouldn't. The only immediate concern I see would be transitioning from inside the cave to out -- There's empty squares, but they aren't always guaranteed to be empty. :)
#9
I totally understand the practical limitations of collision meshes and how it's expensive to have too much detection going on at any one time. I'm fine with that.
The thing is I need to be able to create objects with functional detail that, frankly, could not be created with .dif alone. For example, large holes/burrows dug into the walls, ceilings and floors of a tunnel or large cave that are deep enough to conceal spawn points for creatures that would come out of them. Dif will not allow that and I would need to use DTS. Otherwise, I would be using DIF and then having to create large structures out of DTS objects to simulate the effect, which is more or less defeating the purpose of using DIF in the first place.
So while it's certainly a solution for some situations, .dif is simply not ideal for all of them.
I'll just have to figure out a "happy balance" between the two.
Thanks again for the feedback!
Mike
07/30/2004 (4:39 am)
Hello all and thanks for the feedback!I totally understand the practical limitations of collision meshes and how it's expensive to have too much detection going on at any one time. I'm fine with that.
The thing is I need to be able to create objects with functional detail that, frankly, could not be created with .dif alone. For example, large holes/burrows dug into the walls, ceilings and floors of a tunnel or large cave that are deep enough to conceal spawn points for creatures that would come out of them. Dif will not allow that and I would need to use DTS. Otherwise, I would be using DIF and then having to create large structures out of DTS objects to simulate the effect, which is more or less defeating the purpose of using DIF in the first place.
So while it's certainly a solution for some situations, .dif is simply not ideal for all of them.
I'll just have to figure out a "happy balance" between the two.
Thanks again for the feedback!
Mike
#10
07/31/2004 (7:09 pm)
If you could make a tunnle subclass of the terrain class you could have some detailed tunnles. You could make them be in cylinders rather than a flat plane. They would need to be able to be lengthend, widend, and manipulated with some kind of tunnle entity editor.
Torque 3D Owner Phil Carlisle