Jump to content
The Dark Mod Forums

Patch Thickening


Recommended Posts

This feature was relatively easy to implement (apart from a little confusion on my side regarding patch rows/columns vs. width/height which cost me nearly two hours :P):

 

patchthickeningsm4.th.jpg

 

The dialog looks like this (the thickening affects all selected patches btw):

patchthickeninghj5.th.jpg

 

What's left is a code cleanup and some testing. :)

Link to comment
Share on other sites

Some pretty funky shapes there, especially in the bottom picture. How does it calculate the "thickness", is it extruding the patch along its normal vectors or what?

Exactly. Two adjacent control vertices are taken into consideration for the normals, which allows the thickened counterpart to follow the shape of the source patch.

 

@SneaksieDave: I will upload a new build for you, you can check it out soon.

Link to comment
Share on other sites

Thanks! Got it. :)

 

Here's the result of my first official DarkRadiant thickened patch (there's a small issue which results in some distortion of it, but it looks like a simple problem - image is before/after a tiny amount of vertex manipulation):

 

Will let you know if I come across any other issues of course.

post-58-1171406342_thumb.jpg

Link to comment
Share on other sites

Very useful thing! It would be even better if we could choose among extruding along normals computed for each vertex separately (just like it does now) or one common direction or X, Y or Z axis.

Link to comment
Share on other sites

Very useful thing! It would be even better if we could choose among extruding along normals computed for each vertex separately (just like it does now) or one common direction or X, Y or Z axis.

This sounds useful as well, I'll put that in the features wanted list.

Link to comment
Share on other sites

Ok, that one was not too hard to implement:

 

patchthickening2lv3.th.jpg

 

One disadvantage of having a fixed extrusion axis is that the resulting patches may be inverted (and invisible for the first moment), but that is already covered in another issue (rendering patches as wireframe from behind).

Link to comment
Share on other sites

Here's the result of my first official DarkRadiant thickened patch (there's a small issue which results in some distortion of it, but it looks like a simple problem - image is before/after a tiny amount of vertex manipulation):

 

I noticed that distortion when I tried it -- surely the vertex lines shouldn't cross over like that? Could there be a bug in the normal-calculation code?

Link to comment
Share on other sites

Could you show me an example of such a patch, I'd like to look into that. I already though about taking a "mean" normal vector, as there are 4 available (at most, for a vertex surrounded by four nearest neighbours).

Link to comment
Share on other sites

Ok, I just followed your instructions, but I didn't get a weird patch out of it. This is what I did:

 

Created a cube:

bevelthicken1hy1.th.jpg

 

Clicked: Curve > Bevel, then deleted the cube:

bevelthicken2aw2.th.jpg

 

Then thickened the thing (first with thickness 16, then undid that one and thickened it with thickness 100):

bevelthicken3yn8.th.jpg bevelthicken4ik3.th.jpg

 

What did I wrong?

Link to comment
Share on other sites

I think your second thickened patch is displaying the behaviour -- notice how it gets thinner in the middle and the lines in the "side wall" go diagonally. If it was extruded along the normal, I would expect both the start and end patches to be parallel at all points.

Link to comment
Share on other sites

Yep, but it actually looks like the first has a problem too. I probably should have specified a thickness, so that it's easiest to see. It's hard to tell if it is warping down in the first pic (which would be much more troubling), or back toward the camera, but based on the known behavior, I assume it's back toward the camera. Instead of the normals being perpendicular to the surface, they're collapsing back toward the viewer.

 

My original image above shows not just the before/after fix, but could also be seen as DR/DoomEd. The image on the right is what DoomEd builds.

 

Probably the easiest way to see it is a square - all sides equal.

 

Edit: In fact, looking at my original image and considering the basis for the original patch to be a square, and looking at the control points, it speaks to how it is built. It looks like two control points are placed on the endpoint edges, each half of the desired thickness inward (away from the surface), and then at the corner point, the same is done diagonally.

post-58-1171466900_thumb.jpg

Link to comment
Share on other sites

Ok, hopefully I've got it right this time:

bevelthicken5fg2.th.jpg

 

I had to tweak the normal calculation a bit, taking the average vertex normal. The resulting normal had to be scaled as well, which reminded me a bit of the derivation of Fresnel's law. :)

 

There is still an issue with thickening end caps, which is perhaps a completely different issue, I'll have to check that :)

 

edit: the snapshot is here: http://208.49.149.118/TheDarkMod/download/....8.x.rev968.zip

Link to comment
Share on other sites

I noticed that the simple patch mesh has the option to remove the originating brush (entry #120 - I didn't want to just open it back up since it's not my entry, and maybe you are done with it). Can we have that ability for all types? Or, since the others don't include an intermediate dialog, could it be a global user preference? I find that I never need the brush after making a patch from it.

Link to comment
Share on other sites

Can we have that ability for all types? Or, since the others don't include an intermediate dialog, could it be a global user preference? I find that I never need the brush after making a patch from it.

For what types do you mean exactly? You mean the end caps/inverted bevels?

 

(Besides, I never needed any brush to create a patch, therefore I never missed that option. I never quite understood why I'd have to create a brush first and then a patch out of it, if I can create it from nothing in the first place.)

Link to comment
Share on other sites

(Besides, I never needed any brush to create a patch, therefore I never missed that option. I never quite understood why I'd have to create a brush first and then a patch out of it, if I can create it from nothing in the first place.)

 

Until I read this comment, I was under the impression that the only way to create a patch was from a brush. I just tested, and apparently you can create a simple patch mesh from nothing, which just creates a square patch at the origin.

Link to comment
Share on other sites

Moreover, it creates a patch that fits the size and location of the last selected brush (doesn't have to be selected anymore). So it gets created where you are actually working (I think this area is called "workzone", but I'm not quite sure. At least it gets created in the orthoview where you are currently looking at.

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

    • 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
       
      · 2 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...