Canvatorium Visio Lab 5039
Ornament Attachment Anchor for Volumes.
Ornaments are now supported in Volumes in visionOS 2. This includes several new anchor points.
struct Lab5039: View {
var body: some View {
RealityView { content in
let model = ModelEntity(
mesh: .generateSphere(radius: 0.25),
materials: [SimpleMaterial(color: .black, isMetallic: false)])
content.add(model)
}
.ornament(attachmentAnchor: .scene(.bottom)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomLeading)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomTrailing)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomLeadingBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomLeadingFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomTrailingBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.bottomTrailingFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.top)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topLeading)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topTrailing)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topLeadingBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topLeadingFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topTrailingBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.topTrailingFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.center)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.front)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.back)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.leading)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.trailing)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.leadingBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.trailingBack)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.leadingFront)) {
Lab5039Label()
}
.ornament(attachmentAnchor: .scene(.trailingFront)) {
Lab5039Label()
}
}
}
struct Lab5039Label: View {
var title = "????️"
var body: some View {
Text(title)
.font(.system(size: 96))
}
}