Update: This seems to be related to the format of the video files. It is happening with mp4 files. MOV Files are played with the proper colors.
Post
Replies
Boosts
Views
Activity
@stevenhoward , the line VideoMaterial(avPlayer: player) does compile ok with beta 8 but I am seeing different behavior with this latest beta, for ex., attachments stopped working for me, even after making the small api changes.
I was able to get attachment working. It was just a matter of placing and scaling.
If you decide to use mixed immersion and you want a view( for ex. a menu) that follows the user around you can do the following:
create a head anchor
add a very tiny entity ( to make practically invisible) to the head anchor
add the head anchor to your root entity.
create you view as an attachment and add it to your tiny entity.
I'm unsure if this is the best way to do this. Notwithstanding Apple's visionOS HIG, it works reasonably well.
The attachments API changed a little bit for beta 8, it looks like this now:
attachments: {
Attachment(id: "menuHead") {
...// your view here
}
}
Although what @JoonAhn says is correct, what the visionOS simulator needs to do is provide "simulated" plane information that matches the environments that are provided by Apple. This should not be too difficult, and would remove the requirement of having devs invest on expensive hardware in order to create apps for it.
I was able to get it working. In case anybody is trying to do something similar, these are the steps I followed to be able to drag around an entity I had positioned on a vertical plane and limit the movements along its surface:
Add to the current position of the object being dragged, the translation value from the drag gesture. Don't forget to convert the drag value to world coordinates first.
Do a raycast from the origin in the direction of the dragging object to hit the plane anchor. Remember that the direction vector (based on the dragging object new pos) has to be normalized.
Use the the hit position from the raycast result as the new position for the object. This will keep the the object in the surface of the plane.
I know this explanation is a little abstract and lacking details. If I find time I'll post some sample code in github.
The code in the ObjectPlacement project from Apple was pretty helpful.
It is working now.
Thank you!