i'm trying to figure out how to basically engrave some text into this ellipsoid mesh. so far the only thing i've learned that can sort of come close to what im looking for is SCNText but it floats above the ellipsoid and doesnt conform to the angular shape.
let allocator = MTKMeshBufferAllocator(device: MTLCreateSystemDefaultDevice()!)
let disc = MDLMesh.newEllipsoid(
withRadii: vector_float3(Float(discDiameter/2), Float(discDiameter/2), Float(discThickness/2)),
radialSegments: 64,
verticalSegments: 64,
geometryType: .triangles,
inwardNormals: false,
hemisphere: false,
allocator: allocator
)
let discGeometry = SCNGeometry(mdlMesh: disc)
let material = createIridescentMaterial()
discGeometry.materials = [material]
I tried to reply to the comment but character limit. I think "add normals" just literally adds the data for the normal vectors and puts them all at uniform value. It's just iterating through the vertices. You can sharpen or soften a custom mesh with it if you didn't want to create a SCNGeometrySource for normals. I wouldn't say programmatic normal maps are all that easy of a solution. It's just easier than writing your own boolean geometry routines.
Have you tried to apply the image to the model? I imagine the image will be shrunken at the top and bottom and ballooned out at the equator.
The best way to visualize this may still be to use Blender and create a mockup. See what the resulting maps look like for the look you want. Then that is what you would need to shoot for programmatically. I'm sure there are algorithms for this that can be adapted to Swift without reinventing the wheel.