Solid sphere in unreal engine?

@Everynone Do you have any idea why this is happening ?

As mentioned above, if the procedural mesh is attached, the coordinates are in local space. You’re using world space, it seems.

To clarify:

Take the local camera offset and base the size on that offset.

@Everynone I changed from the world to local using inverse, but it seems like z co-ordiante has some issue with it. It is showing up.


You’re overcomplicating it, see above.

@Everynone yES tried that too !!

BUt there is no luck with the z coorddinate…


This is still incorrect.

  • do not move the procedural mesh component, no need
  • add to relative like I do, otherwise you’re not taking the offset into account
2 Likes

@Everynone it works…but does it create a problem with the rotation ? I mean if the camera is rotated, the trinagle does not move. is there any way i can include the rotation also ?

Attach it to the camera. Unless you want to do a whole bunch of math. This is what I mean:

And since the camera is also attached to the car, the whole thing should work fine. fingers crossed!

If you spawn it dynamically you can attach component to component. But it may be best to just add a component outside of PIE.

Thanks, it is working… :grinning:

1 Like

@Everynone A new challenge, Did you know/worked with any methods which can be used to fill the top gap as shown in the image. I tried my best to create a triangle with procedural mesh from the start to the beginning of the sphere. Yet that gap at the top remains. Is there any option to create any plans or something on top of that ?


May be splines also works ? I can able to find the co-ordinates of the point on top of the sphere ?

Now matter what method you use, you will still need triangles in order to put a material on them => procedural mesh is the only thing that comes to mind that is dynamic enough.

Looks like a bunch of triangles to me:

image

Hey,

  • Does this have to be one mesh (sphere + triangles)? Do you want to be able to hide the triangles?

  • Does the sphere have the correct shape? Compare left / right

  • Do you still need highlighted lines?

  • Are your FOV angles integers or are you using floats with the possibility of decimal places?

2 Likes

@L1z4rD89 Sorry for the late reply. Let me answer the questions.

  1. It will be good to have a single mesh and i need to show the triangle.

  2. Yes the sphere is symetrical in left and right. But it is not same in up/down

  3. No I don’t need the highlighted lines

  4. I am starting with the FOV (both vertical and horizontal) and calculating the points based on general trignometric functions. So yes the points have decimal places

So in the below figure, i created the outside portion of sphere witj material masking, then get the four end points and draw procedural mesh traingles to that points. Now only the top side(green coloured line portion) is remaining.

@Everynone Is the usage of proedural mesh is computationaly expensive ? For filling the remaining gap, i think i have to use a large no. of procedural mesh to get a smooth curve.

Generation can be expensive, especially in BP because loop iteration is sluggish. But you only generate once so it’s expensive only once - hide it behind a loading screen if it gets criminal.

Besides, let’s say you need 5000 triangles. This is negligible under any/most circumstantiates unless you’re targeting a venerable Nokia 3310. If you needed 0.5m tris, you’d need to wait 2 seconds for it to generate. I made those numbers up but wouldn’t be surprised if they were actually precise.

Run a loop, make 1 million textured triangles, see how it behaves.

In short:

  • making triangles is slow
  • showing them is not

@SomeoneMoreExperiencedAndInTheKnowWhoAreReadingThis - asking out of sheer curiosity:

Would making a shape like this be possible / feasible with some of the more advanced boolean tools made available in UE5? Could this shape be carved out of sphere run-time?

Can Nanite do it? Or, perhaps, there is some other way of making a custom shape even if it’d get computationally expensive?

1 Like

And also there is another issue in this sphere. The sphere is flexible in left/right and up/down. i.e. it can be a half sphere or quarter sphere based on the angle input. So i guess the number of triangles that i need to put to cover the top is also changing.

Basically is there any way to plot a plane and cut through it. Is there some method available ?

You can slice procedural meshes. Maybe that will work.

2 Likes

That’s procedural mesh again, you can slice & dice it. Perhaps a better solution would be to take a static mesh sphere, scale it the way you need and then slice off the stuff you do not need. What you’re trying to put together seems to be achievable with this method.

And if you needed to adjust it run-time, make another copy of the SM and re-slice with new params. Have not worked with it much, not my area but have a look at YT vids for examples:

2 Likes

Beat me to it!

2 Likes