This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // RealityRendererView.swift | |
| // RealityRendererTest | |
| // | |
| // Created by Arthur Schiller on 11.01.24. | |
| // | |
| // Change Log: by Yasuhito Nagatomo | |
| // - Added ImageBasedLighting, Mar 2, 2024 | |
| // - Added Camera a rotation animation, Mar 2, 2024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ContentView.swift | |
| // coremlsd2test | |
| // | |
| // Created by Yasuhito Nagatomo on 2022/12/03. | |
| // | |
| // A sample code using Apple/ml-stable-diffusion library. | |
| // Preparation: | |
| // 1. convert the PyTorch Stable-Diffusion v2 model to coreml models using Apple's tools. | |
| // 2. import the coreml models into the iOS project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Type-safe State Machine with Phantom Type May 2022 @AtarayoSD | |
| import Foundation | |
| protocol State {} | |
| // Transitions | |
| protocol TransferableToB {} | |
| protocol TransferableToC {} | |
| protocol TransferableToD {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ContentView.swift | |
| import SwiftUI | |
| import RealityKit | |
| import RealityKitContent | |
| struct ContentView: View { | |
| @State private var showImmersiveSpace = false | |
| @State private var immersiveSpaceIsShown = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // TipKitTestApp.swift | |
| // TipKitTest | |
| // | |
| // Created by Yasuhito Nagatomo on 2024/05/24. | |
| // | |
| // A sample code that uses TipKit in visionOS. | |
| // | |
| // References: | |
| // - Article: Swift with Majid, Discovering app features with TipKit. Basics., 07 May 2024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Modified TAATHub/GradientBorderAnimation.swift on 2025/03/01, Y.Nagatomo | |
| // https://gist.github.com/TAATHub/0d312611e0b31265f85d3c555bf43039 | |
| // Gradient Border Animation | |
| // See Also: https://x.com/sucodeee/status/1894700908824395843 | |
| import SwiftUI | |
| struct ContentView: View { | |
| @State var rotation: CGFloat = 0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // RealityDump.swift | |
| // Created by Yasuhito NAGATOMO on 2022/02/22. | |
| import Foundation | |
| import RealityKit | |
| #if DEBUG | |
| // swiftlint:disable line_length | |
| private let keywords = [ // (string, indentLevel [1...]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension ModelComponent { | |
| /// Dump the MeshResource.Model | |
| func dumpMeshResourceModel() { | |
| let printSIMD3Float = { (value: SIMD3<Float>) in | |
| print("(\(value.x), \(value.y), \(value.z)), ", terminator: "") | |
| } | |
| let printSIMD2Float = { (value: SIMD2<Float>) in | |
| print("(\(value.x), \(value.y)), ", terminator: "") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ObservableTwiceInitProblemTestApp.swift | |
| // ObservableTwiceInitProblemTest | |
| // | |
| // Created by Yasuhito Nagatomo on 2024/05/20. | |
| // | |
| // Modified christianselig/sample-view-model-init.swift | |
| // https://gist.github.com/christianselig/d88b1a4d1989b973689ae62d4691162f | |
| // | |
| // This sample shows Observable object instances with `@Observable and @State` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ContentView.swift | |
| // DebugWindow | |
| // | |
| // Created by Yasuhito Nagatomo on 2023/11/25. | |
| // | |
| import SwiftUI | |
| import RealityKit | |
| import RealityKitContent |
NewerOlder