Archive 17/01/2023.

Sphere, inner surface, CustomGeometry

lheller

Hello

Does anybody know, how to create a sphere using CustomGeometry then add textures on the inner surface of sphere (camera would be also inside) and finally paint anythig on the textures?

jmiller

Hello,

I guess you have reason not to prefer StaticModel… [edit: so I maybe should not get into that yet]
You may have referenced CustomGeometry docs section and sample program, and some CustomGeometry posts and (CSG) tools on the forum…

I’ve learned a lot studying others’ code and there seem to be some interesting articles, e.g. C++ icosphere generation and UV-mapping, and am curious what others in this bright community might have to say.

Bananaft

If you want to draw inside of a shape you just flip it’s normals, or switch culling mode in material properties.

If you want inside and outside show different textures, you have to have two separate meshes with different materials and different culling methods.

Modanung

…and for a sphere constructed around the origin (x == y == z == 0) outward facing normals equal the normalized vertex position. Negated they will face inward.

lheller

Thanks for replies, guys!

At the end I solved it this way:

  1. Created/exported a sphere model in SketchUp application (DAE format).
  2. Using asset imported tool I converted the model from previous step.
  3. Imported that model into a StaticModel component and set cull mode for its material to “None”.
  4. Using raycast/decals I also was able to paint on the inner surface.
Modanung

I’ve you’re going down that path: Have you considered using Blender together with the Urho3D add-on?