Post

Replies

Boosts

Views

Activity

Reply to Is there a way to scale a RealityKit ShapeResource?
Use CPU to calculate update the shader. func transform(_ transform: Transform) async throws -> ShapeResource { if (transform.scale == .one) { return self.offsetBy(rotation: transform.rotation, translation: transform.translation) } else { let mesh = await MeshResource(shape: self) var contents = mesh.contents mesh.contents.models.forEach { model in var mutableModel = model model.parts.forEach { part in var mutablePositions: [SIMD3<Float>] = [] part.positions.forEach { position in let updatedPosition = transform.matrix * SIMD4<Float>(position, 1) mutablePositions.append(updatedPosition.xyz) } var mutablePart = part mutablePart.positions = MeshBuffer<SIMD3<Float>>(mutablePositions) mutableModel.parts.update(mutablePart) } contents.models.update(mutableModel) } try await mesh.replace(with: contents) return try await ShapeResource.generateConvex(from: mesh) } }
Topic: Spatial Computing SubTopic: General Tags:
Jan ’25
Reply to Is there a way to scale a RealityKit ShapeResource?
Thank you for replying. I will update my code to use updatedPosition/updatedPosition.w
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to Is there a way to scale a RealityKit ShapeResource?
Use CPU to calculate update the shader. func transform(_ transform: Transform) async throws -> ShapeResource { if (transform.scale == .one) { return self.offsetBy(rotation: transform.rotation, translation: transform.translation) } else { let mesh = await MeshResource(shape: self) var contents = mesh.contents mesh.contents.models.forEach { model in var mutableModel = model model.parts.forEach { part in var mutablePositions: [SIMD3<Float>] = [] part.positions.forEach { position in let updatedPosition = transform.matrix * SIMD4<Float>(position, 1) mutablePositions.append(updatedPosition.xyz) } var mutablePart = part mutablePart.positions = MeshBuffer<SIMD3<Float>>(mutablePositions) mutableModel.parts.update(mutablePart) } contents.models.update(mutableModel) } try await mesh.replace(with: contents) return try await ShapeResource.generateConvex(from: mesh) } }
Topic: Spatial Computing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to How to find the camera transform (or view matrix) in the world coordinate from a camera frame
Thank you for replying. We have tried camera passthrough in screen capture. It works. However, we are doing further researching: If we can capture only the required objects and exclude some unwanted ones. If we can unproject from a point on a captured frame.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to VisionOS ARKit CameraFrame Sample Parameters Extrinsics
Thank you for the information. There is no API document says the device anchor is the origin of the extrinsics of the camera.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to Xcode 15 linking error
I have the same problem.
Replies
Boosts
Views
Activity
Jun ’23