mapbox / mapbox/mapbox-scenekit

Adding child nodes to terraine nodes on ARSCNView

Open
#46 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
232
Forks
50
PR merge metrics
No merged PRs in 30d

Description

I have tried a good few different combinations but once I'm on ARSCNView I can't seem to add any child nodes. Even If I don't use terrainNode.convertPosition and just try to add a child to the root node, nothing shows.

The child is being added as if I check the count of arView?.scene.rootNode.childNodes it is increasing every time I add a child node but visually I see nothing.

I am adding them like this with a button once everything loaded:

`
let endSphere = SCNNode(geometry: SCNSphere(radius: 100.0))
endSphere.geometry?.firstMaterial?.diffuse.contents = UIColor.red
endSphere.position = (arView?.scene.rootNode.position)!

arView?.scene.rootNode.addChildNode(endSphere)

print(arView?.scene.rootNode.childNodes.count)`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ARSCNView setup and the button callback that creates the SCNSphere, then inspect how the scene rootNode, terrainNode.convertPosition, camera, and node transforms are configured. The issue is resolved when a red sphere added to the scene is visibly rendered and its child-node count still updates as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.