How to draw a hemisphere in unreal engine?

Hey all,

I am planning to draw part of a sphere in unreal engine like a projection from a single point. The shape needs to change depending on the angle between the end edges. I am attaching the image for the reference. What will be the best method to draw the shape in UE4.26 ?

SPHERE-23

I only need to draw the yellow sector bounded by the green thick lines. But based on the angle between the lines, the shape must change.

what about something like this?

Basically is a material that clips UVS with 4 parameters.
You can do the math to use those params to match the desired angle

Hope it helps!
Best,
Dany

1 Like

Hey @eldany.uy Thanks for the information. This is something i am looking for. But i just had couple of doubts in that.

  1. Can I able to get the end points (4 points), so that i can create a line from origin to the end points ?

  2. Here the wireframe material concept is used or not ?

Thanks again

if you want to create a line from the center of the sphere to the points you can use some scaled cube to make a line and parent with a scene component in the center. Then you rotate the scene component to match the end points…UVs go from 0 to 1…so vertical pole to pole angle (0 to 180) is the distance from UP and DOWN parameters…for example if ABS(UP-DOWN) = 0.5 then the angle is 90 degreees.

If vertical angle is 0 and vector is looking down and DOWN parameter is 0.25 then the angle is 45 degrees.

Horizontal UV (U) is all the circle (like the equator) so ) to 1 equals 0 to 360.

No wireframe but you can mix in the material a grid texture and emulate the wireframe.

This approach is with a material and objects UVs, not with actual geometry.

1 Like

image

Have you just made it?

1 Like

Hey

So far as I understood from the video, you just made a material. Then for clipping what did you do ? Duplicate the material and added the blocks. I see two materials in the content browser. SO got a small confusion.

yup

1 Like

Its just a material…one is the base material (like the blueprint of it) and the used one is an instance of the material material where you can tweak the parameters.

those params are named UP DOWN LEFT AND RIGHT…you can find them in the material BP

you can also create a material instance in any blueprint at runtime, apply the instanced material to meshes and then modify its parameters like this:

1 Like

Thanks for the clarification. In your opinion, can i able to create this sphere using splines ?

You can create visible splines with a spline component like this example

but I don’t know what is your goal on all this.

If you just want to make it visual and not actual geometry I think dealing with materials and math is better.

Why do you want to construct a spline sphere when you can just use a sphere mesh with a grid texture on it to make it look wireframed?

OP is making a 3d heads up display:

1 Like

My main goal is just to visualize a field of view. Actually i have a camera in the center point and just need to visualize the sphere based on the camera. So i think i will go with the materials. I had a doubt that does using materials will affect the properties or the environment while in game play ?

yea i am now ok with the lines and in the next phase comes this sphere shaped projection. Donno what is waiting in the coming stages… :joy: :joy:

Now that we better understand what your end goal is, there’s one more thing you can add to your research list:

Widget components can do this. It’s not a sphere but a cylinder - may be suitable enough for your needs.

Is there any sphere option available in the geometry drop down list and is this a new blueprint ?

No. But widgets can be used as materials and placed on anything really. You’d need to research how Render Targets work and this:

image

1 Like

Thanks mahn, i will have a look into that also…

important point: will the FOV change or camera mm will be fixed? like 35mm or 50mm and never change? If so you can just use a static mesh for that…with the central ‘lines’ included

Because we are thinking into something that can be adapted to different FOV angles

1 Like

Yes the fov changes i.e the horizontal and vertical angles should change. But I am not going inside the camera to think the imager size or focal length. I have the angles and the range also (from the center point to the sphere) readily available, so just need to construct the sphere portion with these values.

Just jumping into this - is there a way to make the opacity of the “base color” different (eg semi-transparent - so someone can look through it?)