All Projects → maxxfrazer → Scenekit Scnline

maxxfrazer / Scenekit Scnline

Licence: mit
Draw a tube or thick line in SceneKit

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Scenekit Scnline

Realityui
A Swift Package for creating familiar UI Elements and animations in a RealityKit rendered Augmented Reality or Virtual Reality scene.
Stars: ✭ 275 (+461.22%)
Mutual labels:  swift-package-manager, swiftpm, augmented-reality, arkit
Scenekit Bezier Animations
Create animations over Bezier curves of any number of points
Stars: ✭ 35 (-28.57%)
Mutual labels:  swift-package-manager, swiftpm, arkit, scenekit
ARKit-FocusNode
FocusSquare class taken straight from Apple's ARKit examples and packed up for anyone to use with ease.
Stars: ✭ 50 (+2.04%)
Mutual labels:  augmented-reality, scenekit, arkit
SceneKit-PortalMask
Clean class to create a portal in SceneKit for use in ARKit.
Stars: ✭ 60 (+22.45%)
Mutual labels:  augmented-reality, scenekit, arkit
Arpaint
Draw with bare fingers in the air using ARKit
Stars: ✭ 672 (+1271.43%)
Mutual labels:  augmented-reality, arkit, scenekit
Arkit Projects
Experimenting with ARKit
Stars: ✭ 70 (+42.86%)
Mutual labels:  augmented-reality, arkit, scenekit
Arplayer
Playback videos using ARKit and AVFoundation.
Stars: ✭ 117 (+138.78%)
Mutual labels:  augmented-reality, arkit, scenekit
Unity-ARKit-Plugin
Modified plugin source and Add custom ARKit projects implement on Unity
Stars: ✭ 83 (+69.39%)
Mutual labels:  augmented-reality, scenekit, arkit
TheLaughingMan-ARKit
Use ARKit to become the infamous Laughing Man from Ghost in the Shell
Stars: ✭ 26 (-46.94%)
Mutual labels:  augmented-reality, scenekit, arkit
GVRSCNRenderer
SceneKit Rendering and ARKit 6DOF Tracking for Google Cardboard
Stars: ✭ 19 (-61.22%)
Mutual labels:  augmented-reality, scenekit, arkit
ARKit-Sample-ObjC
ARKit sample application is written in Objective C with features of Add, Remove, Scale, Move, Snapshot for single and multiple objects with plane/surface detection, reset session and AR support checking.
Stars: ✭ 72 (+46.94%)
Mutual labels:  augmented-reality, scenekit, arkit
Arkit By Example
Apple ARKit example app
Stars: ✭ 458 (+834.69%)
Mutual labels:  augmented-reality, arkit, scenekit
Augmentedsolarsystem
An Augmented reality experience to explore planets in our Solar System
Stars: ✭ 69 (+40.82%)
Mutual labels:  augmented-reality, arkit, scenekit
Arkit Floorislava
Basic ARKit example that detects planes and makes them lava.
Stars: ✭ 120 (+144.9%)
Mutual labels:  augmented-reality, arkit, scenekit
DreamBig
☁🌝☁ 3D emoji drawing iPad app with ARKit and the Apple Pencil ☁🌝☁
Stars: ✭ 24 (-51.02%)
Mutual labels:  drawing, augmented-reality, arkit
Argithubcommits
Show your GitHub commit records in 3D with ARKit and SceneKit. 用 ARKit 展示你的 GitHub 提交图
Stars: ✭ 280 (+471.43%)
Mutual labels:  augmented-reality, arkit, scenekit
Arkit Scnpath
Create paths for your Augmented Reality environments using just points to represent the centre of the path.
Stars: ✭ 312 (+536.73%)
Mutual labels:  augmented-reality, arkit, scenekit
3dsnakear
Well known game Snake written in Swift using ARKit.
Stars: ✭ 453 (+824.49%)
Mutual labels:  arkit, scenekit
Arkit Emperor
Power! Unlimited power for ARKit 2.0!
Stars: ✭ 464 (+846.94%)
Mutual labels:  arkit, scenekit
Arsolarplay
通过ARKit实现的太阳系动画
Stars: ✭ 593 (+1110.2%)
Mutual labels:  arkit, scenekit

SCNLine

Functions and classes for creating thick line geometries in a application using SceneKit.

Actions Status Actions Status Swift 5.0

Line Drawing Hello 1

Introduction

SCNLine is a class for drawing lines of a given thickness in 3D space. In most situations in 3D projects the typically used method would use GL_LINES; which can be exercised in SceneKit with this primitive type. However glLineWidth is now depricated, which is initially why I made this class.

For more information on drawing primitive types in OpenGL or otherwise, please refer to this document, or if you want to see how it's applied in SceneKit, check out my first Medium article about building primitive geometries.

Please feel free to use and contribute this library however you like. I only ask that you let me know when you're doing so; that way I can see some cool uses of it!

Installation

Swift Package Manager

Add the URL of this repository to your Xcode 11+ Project.

https://github.com/maxxfrazer/SceneKit-SCNLine.git

CocoaPods

Add to Podfile: pod 'SCNLine', '~> 1.0'

Import

Add to .swift file: import SCNLine

Example

It's as easy as this to a line geometry:

let lineGeometry = SCNGeometry.line(points: [
	SCNVector3(0,-1,0),
	SCNVector3(0,-1,-1),
	SCNVector3(1,-1,-1)
], radius: 0.1).0

Or using the node directly SCNLineNode:

drawingNode = SCNLineNode(
	with: [SCNVector3(0,-1,0), SCNVector3(0,-1,-1), SCNVector3(1,-1,-1)],
	radius: 0.01,
	edges: 12,
	maxTurning: 12
)
drawingNode.add(point: SCNVector3(1,-2,-2))

The latter is recommended if you want to update the line at a later time by adding a point to it.

This will draw a line of radius 10cm from below the origin, forwards and then to the right in an ARKit setup. The y value is set to -1 just as an example that assumes the origin of your scene graph is about 1m above the ground.

Other parameters that can be passed into SCNGeometry.path:

name description default example
points Array of SCNVector3 points to make up the line no default [SCNVector3(0,-1,0), SCNVector3(0,-1,-1), SCNVector3(1,-1,-1)]
radius Radius of the line in meters no default 0.1
edges The number of vertices used around the edge of the tube shaped line to be exteneded throughout the geometry. 12, minimum is 3 16
maxTurning Maximum number of points to make up the curved look when the line is turning to a new direction. 4 16

While in the examples below it shows that this can be used for drawing apps I would not recommend this class for that in its current state, because the current class regathers vertices from the very beginning of the line right to the end, which is very inefficient as most will remain the same.

Here's some basic examples of what you can do with this Pod:

Line Drawing Example 1 Line Drawing Hello 2

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].