sceneform

How to rotate animate the rotation of a Node in ARCore Sceneform

不问归期 提交于 2019-12-08 05:36:01
问题 I understand that 3D animations such as walking are not yet supported in ARCore, but how can I animate the rotation of a Node? I know I can set LocalRotation or WorldRotation but how do I make this animated continuously in a smooth fashion? 回答1: The easiest way is to use the Android Property Animation. An example of doing this is in the Sceneform sample "Solar System". Take a look at RotatingNode. This rotates the node around its axis. First, it creates an ObjectAnimator that uses

How to rotate animate the rotation of a Node in ARCore Sceneform

别来无恙 提交于 2019-12-06 22:53:41
I understand that 3D animations such as walking are not yet supported in ARCore, but how can I animate the rotation of a Node? I know I can set LocalRotation or WorldRotation but how do I make this animated continuously in a smooth fashion? The easiest way is to use the Android Property Animation . An example of doing this is in the Sceneform sample "Solar System". Take a look at RotatingNode . This rotates the node around its axis. First, it creates an ObjectAnimator that uses LinearInterpolation to set the rotation between 4 points around a circle. private static ObjectAnimator

Placing an object with a given compass bearing in ARCore

巧了我就是萌 提交于 2019-12-05 20:35:36
I'd like to place a north facing arrow into an ARCore world using sceneform. I am trying to understand the correct system of transformations to go from the phone's compass to sceneform's quaternions. This was the code I used to solve the problem: //Get the phone's pose in ARCore Pose deviceOrientedPose = frame.getCamera().getDisplayOrientedPose().compose( Pose.makeInterpolated( Pose.IDENTITY, Pose.makeRotation(0, 0, (float)Math.sqrt(0.5f), (float)Math.sqrt(0.5f)), dhelper.getRotation())); float[] devquat = deviceOrientedPose.getRotationQuaternion(); //Get the phone's heading in relation to the

Sceneform Collisions

≯℡__Kan透↙ 提交于 2019-12-02 00:11:03
问题 I'm trying to play a sound and then destroy two objects of two different types when they collide using Sceneform. I see that Sceneform has a collision api (https://developers.google.com/ar/reference/java/com/google/ar/sceneform/collision/package-summary), but I can't figure out how to act on a collision. I've tried extending a collision shape, overriding the shapeIntersection methods, and setting the Collision Shape property for each node, but that doesn't seem to do anything. There doesn't

ARCore – Rendering objects 200m far from camera

空扰寡人 提交于 2019-12-01 18:53:17
I'm working on Android AR project using ARCore and Sceneform. I need to place the objects from 30 meters to 200 meters far from user's camera and faced with the frustum culling issue in ArCore, described HERE . I'm trying to set projection matrix to increase the far parameter using this method public void getProjectionMatrix (float[] dest, int offset, float near, float far); But I can't find possibility to set the rendering projection matrix. Here is my code: arFragment.arSceneView.apply { scene.addOnUpdateListener { // Some code to return from this callback if arFrame is not initialised yet

ARCore – Rendering objects 200m far from camera

∥☆過路亽.° 提交于 2019-12-01 18:46:34
问题 I'm working on Android AR project using ARCore and Sceneform. I need to place the objects from 30 meters to 200 meters far from user's camera and faced with the frustum culling issue in ArCore, described HERE. I'm trying to set projection matrix to increase the far parameter using this method public void getProjectionMatrix (float[] dest, int offset, float near, float far); But I can't find possibility to set the rendering projection matrix. Here is my code: arFragment.arSceneView.apply {

How I can set repeated texture on an object in Android ArCore Sceneform API?

一笑奈何 提交于 2019-12-01 11:01:46
I have successfully made a line between two vectors in the AR Scene. My code: private void addLineBetweenPoints(Scene scene, Vector3 from, Vector3 to) { // prepare an anchor position Quaternion camQ = scene.getCamera().getWorldRotation(); float[] f1 = new float[]{to.x, to.y, to.z}; float[] f2 = new float[]{camQ.x, camQ.y, camQ.z, camQ.w}; Pose anchorPose = new Pose(f1, f2); // make an ARCore Anchor Anchor anchor = mCallback.getSession().createAnchor(anchorPose); // Node that is automatically positioned in world space based on the ARCore Anchor. AnchorNode anchorNode = new AnchorNode(anchor);

How I can set repeated texture on an object in Android ArCore Sceneform API?

半腔热情 提交于 2019-12-01 08:00:19
问题 I have successfully made a line between two vectors in the AR Scene. My code: private void addLineBetweenPoints(Scene scene, Vector3 from, Vector3 to) { // prepare an anchor position Quaternion camQ = scene.getCamera().getWorldRotation(); float[] f1 = new float[]{to.x, to.y, to.z}; float[] f2 = new float[]{camQ.x, camQ.y, camQ.z, camQ.w}; Pose anchorPose = new Pose(f1, f2); // make an ARCore Anchor Anchor anchor = mCallback.getSession().createAnchor(anchorPose); // Node that is automatically