Post

Replies

Boosts

Views

Activity

How to add a custom mesh from a Entity loaded from 3D model, and apply Video Material to it
I have a Entity which is loading a USDZ asset. let modelName = "example.usdz" guard let modelURL = Bundle.main.url(forResource: modelName, withExtension: nil) else { fatalError("Failed to find model file: \(modelName)") } let videoEntity = try! Entity.load(contentsOf: modelURL) Now i am creating a video Material using AVPlayer, VideoMaterial let asset = AVURLAsset(url: url) let playerItem = AVPlayerItem(asset: asset) let player = AVPlayer() let material = VideoMaterial(avPlayer: player) And adding Video material to a sphere videoEntity.components.set(ModelComponent(mesh: .generateSphere(radius: 1E3), materials: [material])) But I want a mesh of my 3d model as shape. Any Possible Ways to Achieve This.
2
0
668
Nov ’23