I am trying to replicate this cube image shape (with permission from the original creator) using scene kit.
SceneKit doesn't provide controls for this. However, SceneKit draws using OpenGL ES, which does.
When you're drawing with GL in the GL_LINES
mode, the glLineWidth
call changes the line width. (Watch out: the argument is in actual pixels, not UI-layout points, so you'll need a larger width than you might think if you don't want super-thin hairlines on a Retina display.)
So, where do you call that in your SceneKit app? You have a few options there. In a simple scene like yours, where you're only rendering one thing, you can just set it before the scene renders. Set a delegate for your view, then implement renderer:willRenderSceneAtTime: and call glLineWidth
there.
However, OpenGL line rendering is pretty limited — if you want to customize rendering more, you'll need a different approach. Just which approach works best depends on exactly what you're going for, so here are a few ideas for you to research:
You can use glLineWidth to set the line width.
Make sure to include OpenGLES in your project.
Here's how your cube looks like with line width set to 8.