This file contains 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 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 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 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 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 2024/01/13. | |
// | |
import Foundation | |
import RealityKit | |
import SwiftUI |
This file contains 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 |
This file contains 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 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
// BillboardComponent.swift | |
import ARKit | |
import RealityKit | |
import SwiftUI | |
public struct BillboardComponent: Component, Codable { | |
public init() {} | |
} |
This file contains 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
# Converting Stable Diffusion v2 models to CoreML models, Dec 17,2022 | |
# | |
# MacBook Air/M1/8GB memory, macOS 13.2 beta, Python 3.8 | |
# apple/ml-stable-diffusion v0.1.0 | |
# | |
(base) ynaga@YasuhitonoMacBook-Air ~ % conda activate coremlsd2_38 | |
(coremlsd2_38) ynaga@YasuhitonoMacBook-Air ~ % cd Temp | |
(coremlsd2_38) ynaga@YasuhitonoMacBook-Air Temp % mkdir SD2ModelConvChunked | |
(coremlsd2_38) ynaga@YasuhitonoMacBook-Air Temp % cd SD2ModelConvChunked | |
(coremlsd2_38) ynaga@YasuhitonoMacBook-Air SD2ModelConvChunked % git clone https://github.com/apple/ml-stable-diffusion |
This file contains 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. |
NewerOlder