Thank you for replying. I will update my code to use updatedPosition/updatedPosition.w
Post
Replies
Boosts
Views
Activity
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)
}
}
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.
Thank you for the information.
There is no API document says the device anchor is the origin of the extrinsics of the camera.
I have the same problem.