reality-composer

How do I spin and add a linear force to an Entity loaded from Reality Composer?

倖福魔咒の 提交于 2020-06-13 06:04:26
问题 I've constructed a scene in Reality Composer that has a ball that starts the scene floating in the air. I'm attempting to programmatically throw the ball while simultaneously spinning it. I tried to do this through behaviors in Reality Composer, but can't get both behaviors to work simultaneously, also, the ball immediately falls to the ground once I start the animation. My second attempt was to forgo the behavior route and I attempted to do this programmatically, but I can not add a force,

How do I spin and add a linear force to an Entity loaded from Reality Composer?

风流意气都作罢 提交于 2020-06-13 06:04:06
问题 I've constructed a scene in Reality Composer that has a ball that starts the scene floating in the air. I'm attempting to programmatically throw the ball while simultaneously spinning it. I tried to do this through behaviors in Reality Composer, but can't get both behaviors to work simultaneously, also, the ball immediately falls to the ground once I start the animation. My second attempt was to forgo the behavior route and I attempted to do this programmatically, but I can not add a force,

RealityKit – How to set a ModelEntity's transparency?

拜拜、爱过 提交于 2020-05-26 08:21:27
问题 In SceneKit, there are lots of options such as Use alpha channel of UIColor via SCNMaterial.(diffuse|emission|ambient|...).contents Use SCNMaterial.transparency (a CGFloat from 0.0 to 1.0) Use SCNMaterial.transparent (another SCNMaterialProperty) Use SCNNode.opacity (a CGFloat from 0.0 (fully transparent) to 1.0 (fully opaque)) I wonder if there is a way to set transparency/opacity/alpha for ModelEntity in RealityKit? 回答1: At the moment I see at least one solution in RealityKit allowing you

RealityKit – How to set a ModelEntity's transparency?

≯℡__Kan透↙ 提交于 2020-05-26 08:21:23
问题 In SceneKit, there are lots of options such as Use alpha channel of UIColor via SCNMaterial.(diffuse|emission|ambient|...).contents Use SCNMaterial.transparency (a CGFloat from 0.0 to 1.0) Use SCNMaterial.transparent (another SCNMaterialProperty) Use SCNNode.opacity (a CGFloat from 0.0 (fully transparent) to 1.0 (fully opaque)) I wonder if there is a way to set transparency/opacity/alpha for ModelEntity in RealityKit? 回答1: At the moment I see at least one solution in RealityKit allowing you

RealityKit - Animate opacity of a ModelEntity?

怎甘沉沦 提交于 2020-02-28 08:48:47
问题 By setting the color of a material on the model property of a ModelEntity , I can alter the opacity/alpha of an object. But how do you animate this? My goal is to animate objects with full opacity, then have them fade to a set opacity, such as 50%. With SCNAction.fadeOpacity on a SCNNode in SceneKit , this was particularly easy. let fade = SCNAction.fadeOpacity(by: 0.5, duration: 0.5) node.runAction(fade) An Entity conforms to HasTransform , but that will only allow you to animate scale,

ARKit & Reality composer - how to Anchor scene using image coordinates

别来无恙 提交于 2020-02-06 06:42:05
问题 I have written code to initialise one of 3 Reality Composer scenes when a button is pressed depending on the day of the month. That all works fine. The Reality Composer scenes use an image detection to place the objects within the environment but currently as soon as the image is out of the camera view the objects disappear. I would like to anchor the scene with the root node being where the image is first detected so that users can look around the scene and the objects are maintained even

ARKit & Reality composer - how to Anchor scene using image coordinates

走远了吗. 提交于 2020-02-06 06:41:48
问题 I have written code to initialise one of 3 Reality Composer scenes when a button is pressed depending on the day of the month. That all works fine. The Reality Composer scenes use an image detection to place the objects within the environment but currently as soon as the image is out of the camera view the objects disappear. I would like to anchor the scene with the root node being where the image is first detected so that users can look around the scene and the objects are maintained even

Reality Kit: Where are 'behaviours' created in reality composer stored in the .rcproject object?

拈花ヽ惹草 提交于 2020-02-05 04:05:49
问题 The situation I am making an AR app in xcode (11.3.1). I have added objects (e.g. a cube) into the scene using reality composer and added behaviours (i.e. tap and flip and look at camera) to those objects, also using reality composer. Saved that, switched to ViewController.swift In ViewController, I load in the Experience.rcproject and access the default Box scene by writing var box = try! Experience.loadBox() . All works as expected. I am then printing the various objects in the hierachy to

How can I reduce the opacity of the shadows in RealityKit?

风流意气都作罢 提交于 2020-01-29 09:53:53
问题 I composed a scene in Reality Composer and added 3 objects in it. The problem is that the shadows are too intense (dark). I tried using the Directional Light in RealityKit from this answer rather than a default light from Reality Composer (since you don't have an option to adjust light in it). Update I implemented the spotlight Lighting as explained by @AndyFedo in the answer. The shadow is still so dark. 回答1: In case you need soft and semi-transparent shadows in your scene , use SpotLight

RealityKit – How to edit or add a Lighting?

拟墨画扇 提交于 2020-01-23 03:51:23
问题 I'm trying to add lighting in my RealityKit AR Scene. And I can't find the Lighting option in Reality Composer. If there's a way to add Directional Light or edit it then please tell me. I've tried Apple Documentation but can't understand how to add them. 回答1: At the moment you can't do it in Reality Composer. Just use a RealityKit. So, you need to create a custom class that inherits from Entity class and conforms to HasPointLight protocol. Run this code in macOS project to find out how a