<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNVector4",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:@S@SCNVector4"
  },
  "title" : "SCNVector4"
}
-->

# SCNVector4

A representation of a four-component vector.

```
struct SCNVector4
```

## Overview

SceneKit uses four-component vectors to represent multiple kinds of data:

- Axis-angle rotation or torque. The `x`, `y`, and `z` fields contain the normalized x-, y-, and z-components of the rotation axis, and the `w` field contains the rotation angle, in radians, or torque magnitude, in newton-meters.
- Color value (or range). The `x`, `y`, `z`, and `w` fields contain the red, green, blue, and alpha components of the color, or the width of the color variation range in each component.

> Important:
> In macOS, the `x`, `y`, `z` and `w` fields in this structure are <doc://com.apple.documentation/documentation/CoreFoundation/CGFloat-swift.struct> values. In iOS, tvOS, and watchOS, these fields are `float` values.

## Topics

### Components

[`x`](/documentation/SceneKit/SCNVector4/x)

The first component in the vector.

[`y`](/documentation/SceneKit/SCNVector4/y)

The second component in the vector.

[`z`](/documentation/SceneKit/SCNVector4/z)

The third component in the vector.

[`w`](/documentation/SceneKit/SCNVector4/w)

The fourth component in the vector.

### Creating Vectors

[`SCNVector4Make`](/documentation/SceneKit/SCNVector4Make(_:_:_:_:))

Returns a new four-component vector created from individual component values.

### Converting Vector Types

[`SCNVector4FromGLKVector4`](/documentation/SceneKit/SCNVector4FromGLKVector4(_:))

Returns a four-element SceneKit vector structure corresponding to a GLKit vector structure.

[`SCNVector4ToGLKVector4`](/documentation/SceneKit/SCNVector4ToGLKVector4(_:))

Returns a four-element GLKit vector structure corresponding to a SceneKit vector structure.

[`SCNVector4FromFloat4`](/documentation/SceneKit/SCNVector4FromFloat4)

[`SCNVector4ToFloat4`](/documentation/SceneKit/SCNVector4ToFloat4)

### Comparing Vectors

[`SCNVector4EqualToVector4`](/documentation/SceneKit/SCNVector4EqualToVector4(_:_:))

Returns a Boolean value that indicates whether the corresponding components of two vectors are equal.

### Zero Constant

[`SCNVector4Zero`](/documentation/SceneKit/SCNVector4Zero)

The four-component vector whose every component is `0.0`.

## Relationships

### Conforms To

[`Escapable`](/documentation/Swift/Escapable)

[`Copyable`](/documentation/Swift/Copyable)

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)