Hello, I’m trying to move my app into vision OS, my app is used for pilot to study the airplane system, is a 3d airplane cockpit build with scene kit and I use sprite scene to animate the cockpit instruments . Scenekit allow to apply as material a sprite scene , so I could animate easy all the different instruments and indication there, but I can’t find this option on reality compose pro , is this possible? any suggestions I can look into to animate and simulate instruments.
Apply sprite scene as material in Reality Composer pro
It sounds like you want to animate a RealityKit entity. Here are a few ways to do that:
Code based animation
Generate an AnimationResource using an AnimationDefinition and pass it to Entity.playAnimation. Here's an example that uses FromToByAnimation to animate an Entity's opacity from zero to one.
let cube = ModelEntity(mesh: .generateBox(size: 0.5), materials: [UnlitMaterial(color: .green)])
if let fadeIn = try? AnimationResource.generate(with: FromToByAnimation<Float>(
from: 0,
to: 1.0,
duration: 2,
bindTarget: .opacity)
) {
cube.playAnimation(fadeIn)
}
cube.position = [0, 1.4, -1.0]
content.add(cube)
USD animations
When you import an entity from a file, for example by using the load(named:in:) method, the entity might contain associated animations. Any that RealityKit supports appear in the availableAnimations array. Here's an example that load's an entity and plays its first animation.
if let entity = try? await Entity(named: "some-entity"),
let animationResource = entity.availableAnimations.first {
entity.playAnimation(animationResource)
}
Timeline based animations in Reality Composer Pro
Compose interactive 3D content in Reality Composer Pro explains how to create timeline based animations using Reality Composer Pro.
Shader graph animations
You can use the Shader Graph in Reality Composer Pro to create shader based animations. Explore materials in Reality Composer Pro covers this fairly well.
I forgot to mention, you can use the shader graph in Reality Composer Pro to create shader based animations. Explore materials in Reality Composer Pro covers this fairly well.