Jump to content
The Dark Mod Forums

Collision Meshes


Springheel

Recommended Posts

I'm fairly certain I've seen collision models on some of our models that are more than 16 polys. What happens if that's the case?

Link to comment
Share on other sites

I was just looking at a model that I'm certain has a bigger collision model than that...I'll have to check it out.

Link to comment
Share on other sites

I was just looking at a model that I'm certain has a bigger collision model than that...I'll have to check it out.

Are you thinking of a static? Statics can have arbitrarily big CMs, but moveables have certain limits. It should be posted in documentation and on the wiki.

Link to comment
Share on other sites

traycollze4.jpg

OK, tried a new collision model. I had also heard that they need to be , ah whats the best word? 'complete'. Not the best word but...

 

for example, a cube is complete. Polys on all sides, no holes. all verts connected.

 

Well to test I figured at least I'd start with polys that were on both sides. So this collision has the 6 polys you see and 6 you don't. All verts welded, All polys connected into one object. BUT the triangles at the edges don't share verts with the polys of the square.

 

It loads up fine, but the physics are haywire. The tray is frobbable but spins off axis if you rotate it. If you throw it it flys happhazzardly across the room. Even beheaded me once.

That was the best match for collision I could think of under 16 polys.

 

I also tried another version where the triangles were reversed, so the point is out and the long side IS attached to the center polys. It's physics were also unstable. maybe 1% better at best.

-------

The collision a few posts up is stable, but again , objects get stuck inside of it. Or float on top.

--------

 

IF the tray HAS to move I guess a REALLY thin cube underneath would pass, but if dropped upside down the edges wouls sink in floor, also objects dropped on the edge would cut right thru the tray.

 

I still vote for non-moveable for excellent physics and looks.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

... I had also heard that they need to be , ah whats the best word? 'complete'. Not the best word but...

 

for example, a cube is complete. Polys on all sides, no holes. all verts connected.

Convex :) As opposed to concave, which won't work. It's a code optimisation. Even if the object has no "holes" in the mesh, the convex requirement means it can't have any cavities either, because that would be concave. So a doughnut or bucket won't work.

 

I remember hearing that Doom 3 objects need to have convex colision. How do AFs work then? They must be handled differently.

Link to comment
Share on other sites

This was what I found on the wiki, quoted from a def file?

 

"max vertices = 32"

"max edges = 32"

"max polygons = 16"

""max edges per polygon = 16"

"The collision model must be an enclosed hull. Dangling polygons or"

"edges are not allowed. If the visual model is too complex or does"

"not meet these requirements it can be contained in a less complex"

"model for collision detection. Such a collision model is specified with the"

"'clipmodel' key."

 

I'm confused about the "max edges per polygon" number...they're not suggesting a sixteen-sided polygon, are they?

 

Also, unless my math is off, (and assuming 3-sided polys) doesn't that limit us to five-sided cylinders, at best? Not great for rolling.

Link to comment
Share on other sites

This was what I found on the wiki, quoted from a def file?

I'm confused about the "max edges per polygon" number...they're not suggesting a sixteen-sided polygon, are they?

It's possible to export collision meshes that aren't exclusively made of triangles (in DarkRadiant/DoomEdit for instance). I guess you can create such collision models with Lightwave too?

Link to comment
Share on other sites

That's interesting...I guess brushes are 4-sided polys. I've never noticed them throwing up console warnings either.

 

I've been reading on D3 and there seems to be a lot of confusion over whether it's 16 polys or 16 faces. Other people are saying 32, and some are swearing there are moveable shelves with holes in them. Guess some experimenting is in order.

Link to comment
Share on other sites

A brush is a convex collection of faces. The faces of a brush can have 16 edges at most for collision meshes (I don't know the theoretical limit for DarkRadiant). At least the 16 edges limit is what the DEF documentation says.

Link to comment
Share on other sites

Also, unless my math is off, (and assuming 3-sided polys) doesn't that limit us to five-sided cylinders, at best? Not great for rolling.

All of the rolling barrels in D3 were faked. They apparently do some rotation of the rendermodel to make it look as if it's rolling when it's really sliding. (I saw this in a comment in a class that was specifically crated for this, idMoveable_Barrel or something like that)

 

On the other hand, I have successfully rolled dinner plates on their edge in Dram's map. So it is do-able, but we shouldn't expect very detailed rolling.

Link to comment
Share on other sites

Is there any way to view a .cm file? I can't load it in lightwave to see how many sides it has.

Link to comment
Share on other sites

IF the tray HAS to move I guess a REALLY thin cube underneath would pass, but if dropped upside down the edges wouls sink in floor, also objects dropped on the edge would cut right thru the tray.

I don't think is a major enough issue to care. Cut the corner and move on. :)

 

Nobody will notice the edges sinking into the floor slightly. They might notice the object, but it's better than having them floating or attaching the tray to the table with superglue, which are the other two choices.

 

I still vote for non-moveable for excellent physics and looks.

The less things that are arbitrarily welded down, the better IMO.

 

If it really bothers you, make two versions: One moveable with a slightly dodgy CM, and one non-moveable with a better one.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

@Domarius, I watched Trainpans (?) vids and he covers the convex thing for terrain. Makes sense. But I'm sure my collision model for the first attempt on the tray was concave, and it worked great as far as picking up, throwing, ect... It's just the probs with dropping items on it and they float, or an author placing items and they get stuck in it.

 

The AF's are simple really. The bucket I made for Ishtvans test has 2 collision models. a cube for the handle and a 5 sided cylinder for the bucket. Works great for grabbing, throwing around. But you can't actually place anything 'inside' the bucket.

 

@Springheel, I was also confused by that, after you posted it I figured I'd do another test.

http://img214.imageshack.us/img214/4241/collisionyu2.jpg

It's a convex shell consisting of '2' polygons. 16 sides each. It hasn't been triangulated. But it looks like all the edges are counted anyway.

I do notice 16 sharp edges though. So know we know what a sharp edge is :D

Maybe I'll post at Doom3World, maybe Derton knows better.

 

@Crispy, I'm not too concerned about the tray, it's a minor prop anyway. I just think objects floating in a map look terrible. Horrible, disgusting lack of detail, ect... (rant continues).

I'm more forgiving of dropping an object and it floats, that can't be atributed to author. The problem is with decent collision objects CAN'T be placed correctly by author or they ALL effectively become welded down.

My point is that it's better to have a tray welded down then the 4 objects on top of it.

 

But more than anything I'm interested mainly in getting the collision props figured out for ALL future objects and any that might need improved.

I only have a few minutes here and there during the week so small tests like this are perfect for that time. On the weekends I like to delve into more complex projects.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

@Domarius, I watched Trainpans (?) vids and he covers the convex thing for terrain. Makes sense. But I'm sure my collision model for the first attempt on the tray was concave, and it worked great as far as picking up, throwing, ect... It's just the probs with dropping items on it and they float, or an author placing items and they get stuck in it.

Well then it's not working is it? :) The physics system simplified it into a convex shape for you. Your concave shape didn't work.

Link to comment
Share on other sites

No, I think it is still the same shape. The objects float but they do fall into the angles that are there. The angles just don't match the model well enough to cover it up, and that is maxed(?) at 16 polys.

 

I posted at D3W so it might be a few days.

 

Gonna sleep now.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I am assuming that those are the results of a concave shape, which is why they are not allowed, and a solid convex shape wouldn't have these wacky issues.

 

If your bucket had 2 collision models, can't you assign more collision models to the tray, so you can make 4 walls and a base that are seperate collision models? (I don't know if there is a limit per object or something)

Link to comment
Share on other sites

I do notice 16 sharp edges though. So know we know what a sharp edge is

 

What's the difference between an edge and a sharp edge?

Link to comment
Share on other sites

Is there any way to view a .cm file? I can't load it in lightwave to see how many sides it has.

 

I'm looking into this. I once wrote an application which read Maya Ascii files, and it already could display models untextured, but the library that I used as GUI support (wxWidgets) has so much changed in the meantime, that it doesn't compile anymore. :( I figured that this would be easily adjusted to read CM files as well, as the format doesn't look so much different, but first I have to fight with that crap wxWidgets now.

 

I'm looking into doing a java application for this, because the format of the file looks rather straightforward. At least the model mesh itself should be no big problem, once I figured out how to do basic OpenGL stuff in java using JOGL.

Gerhard

Link to comment
Share on other sites

The .cm file format is quite easy to read. I had to figure it out when I wrote the CM exporter for DarkRadiant. Basically, it lists all the vertices, edges, polygons and brushes and associates them with each other.

 

If you want to know how many faces a brush has, you have to look into the first number in the "brushes" block:

brushes {
10 {
			...plane equations go here...
} ( -17 -17 0 ) ( 17 17 48 ) "solid"

 

The polygons also have the number of edges written at the beginning of each line. The pseudoformat is

polygons {
numEdges edgeIndexList planeEquation boundingBoxMins/Maxs "shader"
... more polygons here ...
}

This example shows a polygon with 4 edges:

4 ( 1 2 3 4 ) ( 0 0 1 ) 0.5 ( -4.875 -6.875 0.5 ) ( 4.875 7 0.5 ) "textures/common/collision"

Link to comment
Share on other sites

Yeah, I thought as much, but it's always better to confirm by somebody who knows it. It's pretty similar to Maya Ascii export.

I will see how much time i have for this. Since today my boss is on vacation for three weeks, so I guess I probably can nip some time here and there. ;)

 

Then again, I'm his substitue, so I have to pick up when something comes in for him. I hope that I have an easy time though. :)

Gerhard

Link to comment
Share on other sites

<br />What's the difference between an edge and a sharp edge?<br />
<br /><br /><br />

 

Well, in that pic the object is basically 2 16 sided cones (you can only see top one). Actually, it was a 16 side cylinder, I welded all edge verts and pulled the middle verts out.

 

I imagine the sharp edge is the edge around the perimeter. It is traced (like all polys would be if triangulated). I'm actually not sure if that's what makes it 'sharp' or if it's the angle between the faces on each side of the edge that make it sharp. So I guess we don't really know what a sharp edge is :(

 

But we do know that a 16 sided 'poly' is too much.

 

@Domarius. You could build up decent collision with an AF for the tray but way too much trouble I think. Not positive but first I think you need at least 1 bone per AF (the bucket has 2), then it would have to be an md5 file instead of an ase. You'd also have to have an idle anim. Easy but alot of files. Time involved, ect... I'd rather have objects fall thru :D

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...