STEAM-GRUPPE
Blender Source Tools BleST
STEAM-GRUPPE
Blender Source Tools BleST
374
I SPIL
2,189
ONLINE
Grundlagt:
8. november 2013
Alle diskussioner > Help > Trådoplysninger
Kerristrasz 15. mar. 2022 kl. 17:54
Extra faces when exporting model
I've made a model that appears fine in Blender, but when I go to export it, I get a bunch of extra triangles where there should be a gap. I tried removing the collision model to see if that changed anything, and I got the same result. I have a feeling the problem has something to do with the reference mesh being concave, but from my searching online it doesn't seem like that's an issue. What exactly am I doing wrong here?

Blend file: https://pasteall.org/blend/5b83f349e3c34c01ae21e8bbae70b955
Qc file:
$modelname "props_doors/time2mine/oak_door.mdl" $scale 1 $surfaceprop "Wood" $staticprop $body mybody "oak_door.dmx" $sequence idle "oak_door.dmx" fps 1 $collisionmodel "oak_door_phys.dmx" { $concave }
Resulting model: https://imgur.com/a/1dHcs4J
Oprindeligt skrevet af Zappy:
Oprindeligt skrevet af java.lang.SkillException:
- I have a feeling the problem has something to do with the reference mesh being concave, -
That's correct. StudioMDL's triangulation can sometimes mess up with concave polygons, so you should cut the concave polygon into multiple convex polygons instead.

For example, picture that your polygon's edge is a road, and place an imaginary car on it.
Can the car complete an entire lap around the polygon while only turning clockwise (or only counter-clockwise)? If so, it's convex, which is good.
But if it has to turn the other way at some point, the polygon is concave, and you have to split it (at the point where the car turns the second way) to try making multiple convex polygons instead.

In other words, the outside edge must always curve "inward", never "outward". If it curves "outward", you have to cut it where it starts curving out (even if this is for every vertex along a curve).


TL;DR: In this example image (with a cherry pin instead of a door), you'd have to cut at the blue lines in https://imgur.com/LBcHTXE ...or alternatively just use Blender's "Triangulate Faces" option to turn the polygon entirely into triangles.
< >
Viser 1-2 af 2 kommentarer
Forfatteren af denne tråd har angivet, at dette indlæg besvarer det oprindelige emne.
Zappy 16. mar. 2022 kl. 8:06 
Oprindeligt skrevet af java.lang.SkillException:
- I have a feeling the problem has something to do with the reference mesh being concave, -
That's correct. StudioMDL's triangulation can sometimes mess up with concave polygons, so you should cut the concave polygon into multiple convex polygons instead.

For example, picture that your polygon's edge is a road, and place an imaginary car on it.
Can the car complete an entire lap around the polygon while only turning clockwise (or only counter-clockwise)? If so, it's convex, which is good.
But if it has to turn the other way at some point, the polygon is concave, and you have to split it (at the point where the car turns the second way) to try making multiple convex polygons instead.

In other words, the outside edge must always curve "inward", never "outward". If it curves "outward", you have to cut it where it starts curving out (even if this is for every vertex along a curve).


TL;DR: In this example image (with a cherry pin instead of a door), you'd have to cut at the blue lines in https://imgur.com/LBcHTXE ...or alternatively just use Blender's "Triangulate Faces" option to turn the polygon entirely into triangles.
Kerristrasz 16. mar. 2022 kl. 10:57 
Oprindeligt skrevet af Zappy:
...or alternatively just use Blender's "Triangulate Faces" option to turn the polygon entirely into triangles.
Yep, that worked perfectly. Thanks!
< >
Viser 1-2 af 2 kommentarer
Per side: 1530 50

Alle diskussioner > Help > Trådoplysninger