I'm trying to build an MDLMesh then add normals
let mdlMesh = MDLMesh.newBox(withDimensions: SIMD3<Float>(1, 1, 1),
segments: SIMD3<UInt32>(2, 2, 2),
geometryType: MDLGeometryType.triangles,
inwardNormals:false,
allocator: allocator)
mdlMesh.addNormals(withAttributeNamed: MDLVertexAttributeNormal, creaseThreshold: 0)
When I render the mesh, some normals are (0,0,0). I don't know if the problem is in the mesh, or in the conversion to MTKMesh. Is there a way to examine an MDLMesh with the geometry viewer?
When I look at the variable values for my mdlMesh I get this:
Not too useful. I don't know how to track down the normals.
What's the best way to find out where the normals getting broken?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I made a box with MDLMesh.newBox(). I added normals.
let mdlMesh = MDLMesh.newBox(withDimensions: SIMD3<Float>(1, 1, 1),
segments: SIMD3<UInt32>(2, 2, 2),
geometryType: MDLGeometryType.triangles,
inwardNormals:false,
allocator: allocator)
mdlMesh.addNormals(withAttributeNamed: MDLVertexAttributeNormal, creaseThreshold: 0.25)
After I convert to MTKMesh the normals are (0,0,0) for a group of vertices. I can only inspect the geometry after I convert to MTKMesh. Is there a way you can use Geometry Viewer on a MDLMesh?
I'm try to use CoreHID to communicate with a usb hid device that sends custom reports. I have been able to create a client, but when I try to access the elements I get this:
IOServiceOpen failed: 0xe00002e2
This looks like a low level error. I'm hoping someone in the community has seen it, maybe using IOKit and can point me to some information.
I'm try to use CoreHID to communicate with a usb hid device that sends custom reports. I have been able to create a client, but when I try to access the elements I get this:
IOServiceOpen failed: 0xe00002e2
also in:
client.monitorNotifications(reportIDsToMonitor: [HIDReportID.allReports], elementsToMonitor: []) {...
What do I put into "elementsToMonitor: []" array?
Is there an easy(ier) way to work with skeleton tracking? I have an iPad on a stand and I am the model most of the time. I can't stand in front of the camera and see what's on the iPad. I don't think I can use the front camera for tracking. My wife is getting very tired of "Honey, can you come here a minute?"
How is this supposed to work?
I've been watching a 2019 Developer Video "Building Apps with RealityKit" and working along with it. It shows how to create a custom entity. It shows how to load entities from .usd files. How do you either load a custom entity, convert an Entity to a custom entity, or maybe move model hierarchy from an Entity to a custom entity? I assume there's a way to do this.
I'm using playground to experiment with Combine. I found this example on a blog. I expect it to create the Future publisher, wait a couple seconds then send the promise and complete.
import Foundation
import Combine
import SwiftUI
let future = Future<Int, Never> { promise in
print("Creating")
DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
print("sending promise")
promise(.success(1))
}
}
future
.sink(receiveCompletion: { print("receiveCompletion:\($0)") },
receiveValue: { print("receiveValue:\($0)") })
print("end")
The output I expect:
Creating
end
sending promise
receiveValue: ...
receiveCompletion: ...
The output I get:
Creating
end
sending promise
I don't see an indication the promise was executed. What am I doing wrong?