Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not an issue - pointOfView + Arkit #1

Closed
johndpope opened this issue Nov 20, 2017 · 3 comments
Closed

not an issue - pointOfView + Arkit #1

johndpope opened this issue Nov 20, 2017 · 3 comments

Comments

@johndpope
Copy link

I've been working on a solar system with ARKit
https://github.com/johndpope/solarSystem-1
it's leveraging someone else's code base.

My updates are all mostly a bin job - just using to extend understanding before porting updates to
https://github.com/ThumbWorks/AugmentedSolarSystem

I'm stuck on getting the earth as the pointOfView as per you app - and having the celestial bodies spin around them in conjunction with ARKit. I wonder if you had any desire to extend app to support ARKit? I'm looking to create a geocentric point of view of universe. the camera angle would ideally be street view where by the planets match up to their corresponding positions in real life.

@johndpope
Copy link
Author

I used this which caused the motion of planets to fly around earth.
need to tweak camera angle.

    func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
        sceneView.pointOfView?.position = cameraNode.presentation.position
        sceneView.pointOfView?.rotation = cameraNode.presentation.rotation
        sceneView.pointOfView?.orientation = cameraNode.presentation.orientation
        
    }

@dmojdehi
Copy link
Owner

Nice to hear from you, John!

I checked out ThumbWorks/AugmentedSolarSystem when you tagged me in a comment there. Cool project!

I hacked SwiftGlobe into ARKit pretty quickly but didn’t publish it; SwiftGlobe needs to work on macOS & tvOS, and the AR stuff needed orthogonal work. A separate AR version would be good tho.

https://github.com/johndpope/solarSystem-1

Sounds interesting, please post some screenshots there!

the camera angle would ideally be street view where by the planets match up to their
corresponding positions in real life

Do you mean look out from a fixed point of view on the earth (not inward like many AR apps do)? Would you show the earth at all, under the user’s feet?

I'm stuck on getting the earth as the pointOfView as per you app -
I used this which caused the motion of planets to fly around earth.
need to tweak camera angle.

func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
sceneView.pointOfView?.position = cameraNode.presentation.position
sceneView.pointOfView?.rotation = cameraNode.presentation.rotation
sceneView.pointOfView?.orientation = cameraNode.presentation.orientation
}

Nice. I’m surprised you need to do that in the renderer. Did you try attaching the cameraNode to another node, when you’re constructing the scene? (You can use physics springs etc to connect them to get nice tweening, without the heavy math). Afraid I don’t recall how all that works with ARSceneKit...

@johndpope
Copy link
Author

hi @dmojdehi sorry for tardy - just seeing this now.
I failed to change camera. I posted question here + screen shot.
https://stackoverflow.com/questions/47415667/arkit-pointofview-position-rotation-orientation-camera-constraint-on-earth

I guess next attempt is to somehow displace the planets on sun position
using this math http://www.stjarnhimlen.se/comp/tutorial.html#14
and swiftAA
ThumbWorks/AugmentedSolarSystem#46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants