Question: I am in the process of making a simple racing game using Apple's SceneKit library. I have modeled a left turn section of the race track. I am able to successfully load the model into an SCNGeometry that I can then render. However, I would like to be able to use this model for both a left and right turn segment. To do this, I need to mirror the SCNGeometry over the y-z plane, though I can't for the life of me figure out how.

In SpriteKit, one can mirror a sprite by setting the corresponding SKNode's scale to -1. However, if I set the SCNGeometry's SCNNode's x scale to -1, the SCNGeometry will not render at all. While I can mirror the model in my modeling software, I would prefer not to have two basically identical models. Any suggestions would be appreciated.

Answer: 
If you don't want to change the geometry, but just change the texture, you can do:

```
let flip = SCNMatrix4Translate(
        SCNMatrix4Scale(material.diffuse.contentsTransform, 1.0, -1.0, 1.0),
        0, 1, 0
    )
material.diffuse.contentsTransform = flip

```

or directly,

```
material.diffuse.contentsTransform = SCNMatrix4FromGLKMatrix4(GLKMatrix4(m: (
  -1.0, 0.0, 0.0, 0.0,
  0.0, 1.0, 0.0, 0.0,
  0.0, 0.0, 1.0, 0.0,
  -1.0, 0.0, 0.0, 1.0
)))

```

This will replace the texture `x` coordinate by `1-x` which should flip it. I've played around with shaders, and I believe the relevant shader code showing how SceneKit uses the content transform is

```
v_texcoord0 = (u_diffuseTextureMatrix * vec4(_geometry.texcoords[0], 0., 1.)).xy;

```

([see here](https://gist.github.com/gsabran/d705d1a305908156537d2a9418c67a22#file-scnshadable-vertex-shader-vert-L218))
When you scale the geometry to any "-" negative it flip the normals face. the default for normal faces are "One sided"
Set the "Material" property to "Double Sided"

with swift it might look like this

```
yourNode.geometry?.firstMaterial?.doubleSided = true

```