NChartRealityKitModelDelegate Protocol Reference

Conforms to NSObject
Declared in NChartRealityKit.h

Overview

The NChartRealityKitModelDelegate protocol provides methods to create 3D objects compatible with the RealityKit framework based on the models rendered by NChart3D.

– modelReadyWithPositions:normals:texCoords:primitives:vertexCount:indexCount:texture:color:shading: required method

Method that is triggered whenever a new model is being created by NChart3D.

- (void)modelReadyWithPositions:(const simd_float3 *)positions normals:(const simd_float3 *)normals texCoords:(const simd_float2 *)texCoords primitives:(const unsigned int *)primitives vertexCount:(int)vertexCount indexCount:(int)indexCount texture:(CGImageRef)texture color:(UIColor *)color shading:(BOOL)shading

Parameters

positions
  • array of vertex positions of the model. The positions are represented as a sequence of triples containing X, Y, and Z coordinates of each vertex.
normals
  • array of vertex normals of the model. The normals are represented as a sequence of triples containing X, Y, and Z coordinates of each vertex normal vector. nil, if no normals are presented.
texCoords
  • array of vertex texture coordinates of the model. The texture coordinates are representec as a sequence of pairs containing U and V coordinates of the texture map of each vertex. nil, if no texture coordinates are presented
primitives
  • array of indices to navigate in the previous 3 arrays to build primitives.
vertexCount
  • number of vertices in the model. This number determines the count of triples in the positions array, count of triples in the normals array (if presented), and count of pairs in the texCoords array (if presented).
indexCount
  • number of indices in the model. This number determines number of elements in the primitives array.
texture
  • texture of the model (if any) or nil (if no texture is presented).
color
  • color of the model (if any) or nil (if no color is presented).
shading
  • flag indicating if the model should be illuminated by the light source (YES) or not (NO).

Declared In

NChartRealityKit.h