Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transitioning or blending two mesh extrusions
#3
(10-07-2023, 09:17 AM)_Aka_ Wrote: This answer will only address the geometry/mesh aspect of intersections. If you are asking also about how to move objects along intersections, please do clarify this to me.

Geometry is all I need for now. The controllers you have are very straight forward and easy to use.

(10-07-2023, 09:17 AM)_Aka_ Wrote:
  1. Implement a custom mesh merging logic: When the Curvy Generator finishes generating, it (and the relevant modules) triggers an OnRefresh event. You can listen to that event to merge the generated meshes properly.
    I believe the proper mesh merging logic might need to use Boolean Operations. This might be helpful:
    https://stackoverflow.com/questions/5622...h-in-unity

The boolean operation is likely the best option and what I will go with. I am just trying to smooth the transition between the meshes. The link you provided is very helpful.

(10-07-2023, 09:17 AM)_Aka_ Wrote: 2. If the possible intersections are limited (for example only 90 degrees intersections), you can prepare a mesh per possible intersection, and then place those meshes at the intersections:
  • When generating your tunnels, use the Range parameter in the Shape Extrusion so that the generated tunnel does not start at the intersection position, but a little further.
  • Place the right pre-made intersection mesh in the empty space. A simple, no code method is to use a spline controller. Another method, using the API, is to use CurvySpline.Interpolate method (and GetTangent method to help orienting the mesh).


I can definitely do this, but I am hoping to create more than 90 degree junctions, so procedurally doing the junctions/intersections will be best. The junctions into bigger spaces don't need to be perfect, because I will likely have prefab entrance meshes that will make the transitions look a little better, but I am trying to get the meshes to transition as smoothly as possible. 

I have attached a few screen shots of the generation at a few different stages of the process. I will link a video when I get it up on youtube of the current state. I have all the "vert" positions stored for each cell of a 16x16x16 grid chunk that infinitely generates. I already have the path splines generating, placing, & extruding properly. I will be using the same methods I have already to set the verts to create custom cross shapes for different cave paths and caverns. Once I figure out the best way to transition between the meshes, I can add all sorts of variations. 

I have a junction I can generate, I am just trying to figure out how to match the meshes without gaps. One of the images I have shows the issue I am having. I can fill in the top and bottom gap fine by filling the using the splines to fill the hole between and offset the mesh up and down to match, but when I transition two splines together and have a third spline continue the path I have gaps between the cross even though they are using the same shape. I think it has something to do with rasterization, but I am not sure.


Attached Files Thumbnail(s)
                       
Reply


Messages In This Thread
RE: Transitioning or blending two mesh extrusions - by SomeGuyEight - 10-07-2023, 10:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 21 04-17-2024, 10:57 AM
Last Post: _Aka_
  Adjust radius of generated mesh via script? Shackman 1 4 03-26-2024, 01:12 PM
Last Post: _Aka_
  Not seeing mesh extended after following YT PaulM 1 3 02-02-2024, 12:01 PM
Last Post: _Aka_
  Trigger Zones along Spline Mesh dlees9191 1 5 01-05-2024, 10:18 AM
Last Post: _Aka_

Forum Jump: