Giter VIP home page Giter VIP logo

realitykit-cardflip's Introduction

RealityKit CardFlip

I've been using RealityKit a lot since it was released, and am writing Medium posts about different aspects of it as well as adding examples to this app.

For specific details of what's covered, check out my Medium.

CardFlip Example 1


Example code for Apple's new AR framework RealityKit, demonstrating the following things:


TODO:

  • Add game feedback
    • Score counter
  • Audio Playback

Following the RealityKit examples from this keynote, as the code used has not yet been released:

Building Apps with RealityKit


Wishlist for RealityKit:

  • Particles
  • Custom Mesh Generation

realitykit-cardflip's People

Contributors

maxxfrazer avatar rodericj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realitykit-cardflip's Issues

iPad Pro app launching but not showing anything

I wanted to learn more about Reality Kit and tried to launch the app on my iPad Pro 2019. App compiles and launches. Uses my camera but I see nothing. Not sure what is missing. I tried to move around and tap the screen but nothing. :)
(ps. Xcode 12 and Big Sur)

Anchoring and position of spawned Entity

Based on your Class example of Entity, I made something like this:

//
//  ViewController.swift
//  ARClassExample
//
//  Created by JIMMY GUNAWAN on 17/8/19.
//  Copyright © 2019 JIMMY GUNAWAN. All rights reserved.
//

import UIKit
import RealityKit




class ViewController: UIViewController {
    
    @IBOutlet var arView: ARView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Load the "Box" scene from the "Experience" Reality File
        let boxAnchor = try! Experience.loadBox()
        
        // Add the box anchor to the scene
        arView.scene.anchors.append(boxAnchor)
        
        // example Class CustomBox
        // maxxfrazer
        class CustomBox: Entity, HasModel {
          required init(color: UIColor) {
            super.init()
            self.components[ModelComponent] = ModelComponent(
                mesh: .generateBox(size: [0.01, 0.02, 0.011]),
              materials: [SimpleMaterial(
                color: color,
                isMetallic: false)
              ]
            )
          }
            
            required init() {
                fatalError("init() has not been implemented")
            }
        }
        
        let boxA = CustomBox(color: UIColor.red)
        boxA.position = SIMD3(0.0, 0.1, 0.0)
        
        let boxB = CustomBox(color: UIColor.green)
        boxB.position = SIMD3(0.0, 0.2, 0.0)
        
        let boxC = CustomBox(color: UIColor.blue)
        boxC.position = SIMD3(0.0, 0.3, 0.0)
        
        boxAnchor.addChild(boxA)
        boxAnchor.addChild(boxB)
        boxAnchor.addChild(boxC)


        
    }
}

I am however surprised by how the Entity being created procedurally is positioned in the "wrong place". I thought I use the boxAnchor (default AR template) and was hoping the entities placed at zero zero zero world axis.

Playing back User's custom animation USDZ

Hi Max, do you have any tips on how to playback user custom animation (character animation, USDZ, originally from Mixamo).

I tried something like below and not working somewhat.

            //monkey.availableAnimations
            
            //AnimationResource.
            
            let anim = monkey.availableAnimations
            // animation name = "Armature|mixamo.com|Layer0|"
            
            //monkey.playAnimation(anim[0], transitionDuration: 0.5, startsPaused: false)
            
            //monkey.playAnimation(anim[0], transitionDuration: 2.5, startsPaused: true)

            monkey.playAnimation(anim[0])
            
            monkey.playAnimation(named: "Armature|mixamo.com|Layer0|") // weird that this does not work.

So far, the easiest way is perhaps to load entity that's already assigned animation via Reality Composer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.