Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RoomPlan for iOSDCJapan2024

alt9800
August 23, 2024

RoomPlan for iOSDCJapan2024

iOSDCでルーキーズLTとして発表した資料をスライドにしました。
短いセッションですが、
RoomPlanのデモ、サンプルコードの利用、エクスポートされるUSDZとはなんなのか?といったお話をしています。

#RoomPlan
#ARKit
#Swift
#USDZ

alt9800

August 23, 2024
Tweet

More Decks by alt9800

Other Decks in Technology

Transcript

  1. 5

  2. ├── Configuration │ └── SampleCode.xcconfig ├── LICENSE │ └── LICENSE.txt

    ├── README.md ├── RoomPlanExampleApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── Base.lproj │ ├── Info.plist │ ├── OnboardingViewController.swift │ ├── RoomCaptureViewController.swift │ └── SceneDelegate.swift └── RoomPlanExampleApp.xcodeproj ├── project.pbxproj ├── project.xcworkspace └── xcshareddata 10
  3. 補足 : このあたり @IBAction func exportResults(_ sender: UIButton) { let

    destinationURL = FileManager.default.temporaryDirectory.appending(path: "Room.usdz") ~略~ } 15
  4. USDZの簡単な構造 Room.usdz ├── Room.usda └── assets └── Parametric ├── Chair

    │ ├── Chair0.usda │ ├── Chair1.usda │ ├── Chair2.usda │ ├── Chair3.usda │ ├── Chair4.usda │ ├── Chair5.usda │ └── Chair6.usda ├── Floors │ └── Floor0.usda ├── Table │ ├── Table0.usda │ └── Table1.usda └── Walls └── Wall0 └── Wall0.usda 16
  5. USDAの構造 #usda 1.0 ( defaultPrim = "Wall0" metersPerUnit = 1

    upAxis = "Y" ) def Xform "Wall0" ( assetInfo = { asset identifier = @./Wall0.usda@ string name = "Wall0" } customData = { string Category = "Wall" string UUID = "81048711-BBA3-4BE4-90CA-942061F2C13E" } kind = "component" ) { def Cube "Wall0" { rel material:binding = </Wall0/Wall0_color> double size = 1 double3 xformOp:scale = (7.546441078186035, 2.549999952316284, 0.00009999999747378752) matrix4d xformOp:transform = ( (-0.41756635904312134, 0, -0.9086464643478394, 0), (0, 1.0000001192092896, 0, 0), (0.9086465239524841, 0, -0.4175664484500885, 0), (-1.1913783550262451, 0.3747645616531372, 0.13431057333946228, 1) ) uniform token[] xformOpOrder = ["xformOp:transform", "xformOp:scale"] } def Material "Wall0_color" { token outputs:surface.connect = </Wall0/Wall0_color/surfaceShader.outputs:surface> def Shader "surfaceShader" { uniform token info:id = "UsdPreviewSurface" color3f inputs:diffuseColor = (1, 1, 1) color3f inputs:emissiveColor = (0, 0, 0) normal3f inputs:normal = (1, 1, 1) float inputs:occlusion = 1 float inputs:opacity = 1 token outputs:surface } } } 18
  6. 座標系 左手系 Y軸 UP : Unity , Cinema 4D 右手系

    Z軸 UP : Blender USDは右手系 #usda 1.0 ( defaultPrim = "Room" metersPerUnit = 1 upAxis = "Y" ) と軸を指定できる (何も指定しないとデフォルトで Y-UP) ➔ Unityなどへの読み込み時には X軸に対しての反転が必要。 19
  7. 28

  8. 34