This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Spline File Format

Spline File Structure

A spline file is an .spl text file, based on the json format. This file contains all necessary information to define a spline graph consisting of points in 3D space, connected by cubic Bezier spline segments. Spline graphs can be adjusted by manually editing an .spl file in a text editor or via API.

There are 2 basic sections in the .spl file:

  • Points. This section contains the list of all points of the spline graph represented by their coordinates (X, Y, Z).
  • Segments. This section contains the list of spline segments connecting different points.

In general the syntax of the .spl file is as follows:

Source code
{
	"points": [
		[
			-1335.1749267578125,
			78.811111450195313,
			4.7690000534057617
		],
		
		...
		
	],
	"segments": [
		{
			"start_index": 0,
			"start_tangent": [
				-4.7529296875,
				4.06640625,
				-2.1245796233415604e-009
			],
			"start_up": [
				0,
				0,
				1
			],
			"end_index": 1,
			"end_tangent": [
				2.8794116973876953,
				-1.2208551168441772,
				8.9795076929632955e-010
			],
			"end_up": [
				0,
				0,
				1
			]
		},
		
		...
		
	]
}

Points Data

The first section of the .spl file contains the array of spline points. Each point is represented as an array of 3 coordinates (X, Y, Z). The number of points is not limited. Vertex indices come in the order of appearance starting from 0.

Source code
"points": [
		[
			-1335.1749267578125,
			78.811111450195313,
			4.7690000534057617
		],
		[
			-1404.5445556640625,
			150.18548583984375,
			3.8284587860107422
		],
		[
			-1427.984130859375,
			153.21903991699219,
			3.1477432250976562
		],
		[
			40.473739624023438,
			563.27911376953125,
			2.1209244728088379
		], 
		
		...
	]

Segments Data

The second section of the .spl file contains the list of spline segments connecting the points described above. The number of segments is not limited and does not depend on the number of points.

Each of the segments is represented by the following elements:

start_index

Index of the spline segment's starting point in the list of points.

start_tangent

Tangent coordinates at the starting point of the spline segment. Tangent coordinates define the form of the segment.

start_up

"Up" vector coordinates at the starting point of the spline segment.

end_index

Index of the spline segment's ending point in the list of points.

end_tangent

Tangent coordinates at the ending point of the spline segment. Tangent coordinates define the form of the segment.

end_up

"Up" vector coordinates at the ending point of the spline segment.

Source code
"segments": [
		{
			"start_index": 0,
			"start_tangent": [
				-4.7529296875,
				4.06640625,
				-2.1245796233415604e-009
			],
			"start_up": [
				0,
				0,
				1
			],
			"end_index": 1,
			"end_tangent": [
				2.8794116973876953,
				-1.2208551168441772,
				8.9795076929632955e-010
			],
			"end_up": [
				0,
				0,
				1
			]
		}, 
		
		...
	]
Last update: 2018-08-10
Build: ()