Using pan gesture how to do smooth drawing on ARSCNViewHow to change the name of an iOS app?How to check for an active Internet connection on iOS or macOS?How can I make a UITextField move up when the keyboard is present - on starting to edit?How to “add existing frameworks” in Xcode 4?How can I disable ARC for a single file in a project?How to download Xcode DMG or XIP file?How to call Objective-C code from SwiftWhy don't use var at the beginning?UIScrollView cannot display image either in Portrait or Landscape modeSmooth object rotation in ARSCNView
Riley's, assemble!
Pros and cons of writing a book review?
Can Green-Flame Blade be cast twice with the Hunter ranger's Horde Breaker ability?
Count down from 0 to 5 seconds and repeat
What happens if you do emergency landing on a US base in middle of the ocean?
If Boris Johnson were prosecuted and convicted of lying about Brexit, can that be used to cancel Brexit?
Word for a small burst of laughter that can't be held back
Chopin: marche funèbre bar 15 impossible place
Do manufacturers try make their components as close to ideal ones as possible?
Bent spoke design wheels — feasible?
Incremental Ranges!
The ring of global sections of a regular scheme
My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?
Is the decompression of compressed and encrypted data without decryption also theoretically impossible?
Is the capacitor drawn or wired wrongly?
Traffic law UK, pedestrians
I wrote a scene that the majority of my readers loved. How do I get back to that place while writing my new book?
Do adult Russians normally hand-write Cyrillic as cursive or as block letters?
California: "For quality assurance, this phone call is being recorded"
Explain Ant-Man's "not it" scene from Avengers: Endgame
Is it legal in the UK for politicians to lie to the public for political gain?
Does the growth of home value benefit from compound interest?
Why don't B747s start takeoffs with full throttle?
What is the advantage of carrying a tripod and ND-filters when you could use image stacking instead?
Using pan gesture how to do smooth drawing on ARSCNView
How to change the name of an iOS app?How to check for an active Internet connection on iOS or macOS?How can I make a UITextField move up when the keyboard is present - on starting to edit?How to “add existing frameworks” in Xcode 4?How can I disable ARC for a single file in a project?How to download Xcode DMG or XIP file?How to call Objective-C code from SwiftWhy don't use var at the beginning?UIScrollView cannot display image either in Portrait or Landscape modeSmooth object rotation in ARSCNView
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to draw smooth attached lines on ARSCNView, I have tried SCNNode and SCNSphere but it shows dotted line rather than single whole line. When I get my camera closer to the line it literally seems dotted and distributed
I have tried some accepted answers from other users but it does not produce what want, Please check my code below.
import UIKit
import ARKit
class DrawingView:UIViewController,ARSCNViewDelegate
//MARK: Class properties
lazy var sceneView:ARSCNView=
let sv = ARSCNView()
sv.delegate = self
let panToDrawGesture = UIPanGestureRecognizer(target: self, action: #selector(createNodesFromPan(_:)))
sv.addGestureRecognizer(panToDrawGesture)
return sv
()
//MARK: Lifecycle methods
override func viewDidLoad()
super.viewDidLoad()
self.setUpViews()
override func viewWillAppear(_ animated: Bool)
super.viewWillAppear(animated)
let configuration = ARWorldTrackingConfiguration()
sceneView.session.run(configuration)
override func viewWillDisappear(_ animated: Bool)
super.viewWillDisappear(animated)
sceneView.session.pause()
//MARK: Class methods
func setUpViews()
self.view.backgroundColor = .lightGray
self.title = "Drawing"
self.view.addSubview(sceneView)
sceneView.frame = self.view.frame
//MARK: Other methods
@objc func createNodesFromPan(_ gesture: UIPanGestureRecognizer)
let currentTouchPoint = gesture.location(in: self.sceneView)
guard let featurePointHitTest = self.sceneView.hitTest(currentTouchPoint, types: .featurePoint).first else return
let worldCoordinates = featurePointHitTest.worldTransform
let sphereNode = SCNNode()
let sphereNodeGeometry = SCNSphere(radius: 0.005)
sphereNodeGeometry.firstMaterial?.diffuse.contents = UIColor.blue
sphereNode.geometry = sphereNodeGeometry
sphereNode.position = SCNVector3(worldCoordinates.columns.3.x, worldCoordinates.columns.3.y, worldCoordinates.columns.3.z)
self.sceneView.scene.rootNode.addChildNode(sphereNode)
I am trying to achieve smooth drawing lines which does not look dotted or distributed.
ios swift xcode augmented-reality arkit
add a comment |
I am trying to draw smooth attached lines on ARSCNView, I have tried SCNNode and SCNSphere but it shows dotted line rather than single whole line. When I get my camera closer to the line it literally seems dotted and distributed
I have tried some accepted answers from other users but it does not produce what want, Please check my code below.
import UIKit
import ARKit
class DrawingView:UIViewController,ARSCNViewDelegate
//MARK: Class properties
lazy var sceneView:ARSCNView=
let sv = ARSCNView()
sv.delegate = self
let panToDrawGesture = UIPanGestureRecognizer(target: self, action: #selector(createNodesFromPan(_:)))
sv.addGestureRecognizer(panToDrawGesture)
return sv
()
//MARK: Lifecycle methods
override func viewDidLoad()
super.viewDidLoad()
self.setUpViews()
override func viewWillAppear(_ animated: Bool)
super.viewWillAppear(animated)
let configuration = ARWorldTrackingConfiguration()
sceneView.session.run(configuration)
override func viewWillDisappear(_ animated: Bool)
super.viewWillDisappear(animated)
sceneView.session.pause()
//MARK: Class methods
func setUpViews()
self.view.backgroundColor = .lightGray
self.title = "Drawing"
self.view.addSubview(sceneView)
sceneView.frame = self.view.frame
//MARK: Other methods
@objc func createNodesFromPan(_ gesture: UIPanGestureRecognizer)
let currentTouchPoint = gesture.location(in: self.sceneView)
guard let featurePointHitTest = self.sceneView.hitTest(currentTouchPoint, types: .featurePoint).first else return
let worldCoordinates = featurePointHitTest.worldTransform
let sphereNode = SCNNode()
let sphereNodeGeometry = SCNSphere(radius: 0.005)
sphereNodeGeometry.firstMaterial?.diffuse.contents = UIColor.blue
sphereNode.geometry = sphereNodeGeometry
sphereNode.position = SCNVector3(worldCoordinates.columns.3.x, worldCoordinates.columns.3.y, worldCoordinates.columns.3.z)
self.sceneView.scene.rootNode.addChildNode(sphereNode)
I am trying to achieve smooth drawing lines which does not look dotted or distributed.
ios swift xcode augmented-reality arkit
add a comment |
I am trying to draw smooth attached lines on ARSCNView, I have tried SCNNode and SCNSphere but it shows dotted line rather than single whole line. When I get my camera closer to the line it literally seems dotted and distributed
I have tried some accepted answers from other users but it does not produce what want, Please check my code below.
import UIKit
import ARKit
class DrawingView:UIViewController,ARSCNViewDelegate
//MARK: Class properties
lazy var sceneView:ARSCNView=
let sv = ARSCNView()
sv.delegate = self
let panToDrawGesture = UIPanGestureRecognizer(target: self, action: #selector(createNodesFromPan(_:)))
sv.addGestureRecognizer(panToDrawGesture)
return sv
()
//MARK: Lifecycle methods
override func viewDidLoad()
super.viewDidLoad()
self.setUpViews()
override func viewWillAppear(_ animated: Bool)
super.viewWillAppear(animated)
let configuration = ARWorldTrackingConfiguration()
sceneView.session.run(configuration)
override func viewWillDisappear(_ animated: Bool)
super.viewWillDisappear(animated)
sceneView.session.pause()
//MARK: Class methods
func setUpViews()
self.view.backgroundColor = .lightGray
self.title = "Drawing"
self.view.addSubview(sceneView)
sceneView.frame = self.view.frame
//MARK: Other methods
@objc func createNodesFromPan(_ gesture: UIPanGestureRecognizer)
let currentTouchPoint = gesture.location(in: self.sceneView)
guard let featurePointHitTest = self.sceneView.hitTest(currentTouchPoint, types: .featurePoint).first else return
let worldCoordinates = featurePointHitTest.worldTransform
let sphereNode = SCNNode()
let sphereNodeGeometry = SCNSphere(radius: 0.005)
sphereNodeGeometry.firstMaterial?.diffuse.contents = UIColor.blue
sphereNode.geometry = sphereNodeGeometry
sphereNode.position = SCNVector3(worldCoordinates.columns.3.x, worldCoordinates.columns.3.y, worldCoordinates.columns.3.z)
self.sceneView.scene.rootNode.addChildNode(sphereNode)
I am trying to achieve smooth drawing lines which does not look dotted or distributed.
ios swift xcode augmented-reality arkit
I am trying to draw smooth attached lines on ARSCNView, I have tried SCNNode and SCNSphere but it shows dotted line rather than single whole line. When I get my camera closer to the line it literally seems dotted and distributed
I have tried some accepted answers from other users but it does not produce what want, Please check my code below.
import UIKit
import ARKit
class DrawingView:UIViewController,ARSCNViewDelegate
//MARK: Class properties
lazy var sceneView:ARSCNView=
let sv = ARSCNView()
sv.delegate = self
let panToDrawGesture = UIPanGestureRecognizer(target: self, action: #selector(createNodesFromPan(_:)))
sv.addGestureRecognizer(panToDrawGesture)
return sv
()
//MARK: Lifecycle methods
override func viewDidLoad()
super.viewDidLoad()
self.setUpViews()
override func viewWillAppear(_ animated: Bool)
super.viewWillAppear(animated)
let configuration = ARWorldTrackingConfiguration()
sceneView.session.run(configuration)
override func viewWillDisappear(_ animated: Bool)
super.viewWillDisappear(animated)
sceneView.session.pause()
//MARK: Class methods
func setUpViews()
self.view.backgroundColor = .lightGray
self.title = "Drawing"
self.view.addSubview(sceneView)
sceneView.frame = self.view.frame
//MARK: Other methods
@objc func createNodesFromPan(_ gesture: UIPanGestureRecognizer)
let currentTouchPoint = gesture.location(in: self.sceneView)
guard let featurePointHitTest = self.sceneView.hitTest(currentTouchPoint, types: .featurePoint).first else return
let worldCoordinates = featurePointHitTest.worldTransform
let sphereNode = SCNNode()
let sphereNodeGeometry = SCNSphere(radius: 0.005)
sphereNodeGeometry.firstMaterial?.diffuse.contents = UIColor.blue
sphereNode.geometry = sphereNodeGeometry
sphereNode.position = SCNVector3(worldCoordinates.columns.3.x, worldCoordinates.columns.3.y, worldCoordinates.columns.3.z)
self.sceneView.scene.rootNode.addChildNode(sphereNode)
I am trying to achieve smooth drawing lines which does not look dotted or distributed.
ios swift xcode augmented-reality arkit
ios swift xcode augmented-reality arkit
asked Mar 24 at 13:05
indrajitindrajit
1198
1198
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324085%2fusing-pan-gesture-how-to-do-smooth-drawing-on-arscnview%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324085%2fusing-pan-gesture-how-to-do-smooth-drawing-on-arscnview%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown