sceneform-android-sdk | Sceneform SDK for Android | Android library
kandi X-RAY | sceneform-android-sdk Summary
kandi X-RAY | sceneform-android-sdk Summary
Sceneform SDK for Android
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sets the content view
- Activates this component
- Sets the renderable for this node
- Checks to see if the given Activity is supported or not
- Builds the material parameters
- Get a texture by name
- Load the models into a CompletableFuture
- Convert sampler definition to min filter min filter
- This method can be overridden by subclasses to handle touch events
- Compares two vectors
- Updates the dragging state
- This method can be called to check if touch is enabled
- Convert a point in world space to screen space
- Create the model pipeline import
- This method can be called to start motion events
- Sets the global scale of this node
- Creates a cylinder with the specified parameters
- Test if there is an intersection with the intersection
- Creates a sphere with the specified parameters
- Builds the internal renderable data
- Loads the Light probe
- Convert a texture sampler to a textureSampler
- Creates a new FilamentAsset instance
- Creates a cube with the specified parameters
- Render the frame
- This method is called when a drag gesture is encountered
sceneform-android-sdk Key Features
sceneform-android-sdk Examples and Code Snippets
Community Discussions
Trending Discussions on sceneform-android-sdk
QUESTION
I am trying to put earings on the face using arcore augmented face. I am editing the 3D model in blender and adjusting the model according to canonical_face_mesh.fbx .
But my 3d model is rendering above the head.
I also tried making the pivot point of my model same as that of canonical_face_mesh.fbx, (as mentioned in this SO question) but still when running in app it's rendering
...ANSWER
Answered 2019-Oct-01 at 11:41The problem was
- I was not placing custom meshes as children of the asset node as mentioned in doc.
To make the custom mesh or the object a child of the asset node:
i) Load the given canonical face mesh in blender file->import->fbx
then browse for your downloaded canonical face mesh.
(Note: Every SDK has its own reference face mesh and they differ; make sure you use correct one).
ii) Then load your custom 3D model.
iii) Scale and align your model according to the canonical face mesh wherever you want it to be.
iv) In object mode press ctrl + shift +p
and then click your custom model and then click the bones present in canonical face mesh.A selection menu will appear select object in that menu.
This will make your model, the child of the asset node.
- Now you need to add Vertex Group in your model. To do so:
i) Select all vertex in your model in edit mode.
ii) Then go to context object data menu. Click the + icon and name your Vertex ( NOSE_TIP, FOREHEAD_RIGHT, or FOREHEAD_LEFT ). This you have to assign according to your model. Mine is Nose Pin so i choose NOSE_TIP. Then Click assign.
Now to cross check you can deselect your model and then click your vertex group and click on select button next to assign button you will notice that your model is selected now.
- You need to add modifier. To add modifier
i) Click on the modifier option.
ii) Then click add modifier you will see a drop down menu in that select armature.
iii) Name it as asset as shown above select object as asset and select Nose_TIP as shown above.
Now Delete only the facemesh from the asset.
and import your model.
QUESTION
I'm tinkering with the Sceneform SDK's Augmented Image sample code after I completed the accompanying code lab. The completed sample adds two types of objects to the AR scene: one is modeled with a CAD software and loaded from an sfb
binary (that's the green maze) and the other one is a red ball which is constructed run-time using the MaterialFactory
and ShapeFactory
.
A simple experiment is to remove the green maze to only have the red ball (and remove the physics engine of course as well). In that case however the red ball does not appear on the AR scene.
The interesting thing is that the green maze does not have to appear on the scene - by that I mean I don't have to create the Node
, assign renderable, etc. https://github.com/CsabaConsulting/sceneform-android-sdk/blob/master/samples/augmentedimage/app/src/main/java/com/google/ar/sceneform/samples/augmentedimage/AugmentedImageNode.java#L139:
ANSWER
Answered 2020-Apr-04 at 06:03This happened because implicitly the Factory based scene building contains CompletableFuture
as well! More specifically the material building is a function which returns CompletableFuture
.
Not realizing this, I haven't quoted the important code section in the question. You can see that the just below the Maze model loader instructions:
QUESTION
I've been getting my butt kicked trying to get a vertically placed 3d model GLB format placed properly on a vertical surface.
Just to be clear, I am not referring to the difficulty of identifying vertical surface, that is a whole other problem in itself.
Removing common boilerplate of setup to minimize this post.
I am using a fragment that extends ARFragment.
...ANSWER
Answered 2019-Nov-22 at 20:48Well I finally got it. Took awhile and some serious trial and error of rotating every node, axis, angle, and rotation before I finally got it to place nicely. So I'll share my results in case anyone else needs this as well.
Of course it is mildly subjective to how you held the phone and it's understanding of the surroundings, but it's always pretty darn close to level now without fail in both landscape and portrait testing that I have done.
So here's what I've learned.
Setting the worldRotation on the anchorNode will help keep the 3DModel facing towards the cameraview using a little subtraction.
QUESTION
In the following Android lifecycle method:
...ANSWER
Answered 2020-Jan-20 at 15:53The documentation for Fragment.onCreateView()
indicates the following:
This will be called between onCreate(Bundle) and onActivityCreated(Bundle).
The Android framwork makes all lifecycle calls itself.The Android framework will call onCreate()
on the fragmentto initialize the fragment. At some later time, the Android framework will call
onCreateView()` on the fragment. The following parameters are passed:
LayoutInflater
: TheLayoutInflater
object that can be used to inflate any views in theFragment
. The framework gets theLayoutInflater
from theActivity
'sContext
.ViewGroup
: If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate theLayoutParams
of the view. This parameter is the containerView
that holds theFragment
.
Bundle
: If non-null, this fragment is being re-constructed from a previous saved state as given here. In this case, the Bundle
contains the most recently saved state of the Fragment
(ie: the data from the most recent call made to the Fragment
s onSaveInstanceState()
method).
Regarding your other questions:
If you define a method
foo()
, the Android framework would never call it. The Android framework has a specific set of defined methods that it calls on certain components (Activity, Service, BroadcastReceiver, Fragment
, etc.) at specific times.The
View
returned fromonCreateView()
will be used by the Android framework. The documentation clearly indicates how the returnedView
object is used:
If you return a View from here, you will later be called in
onDestroyView()
when the view is being released.
QUESTION
I'm building an AR navigation app and I'm not really familiar with AR aspect of it. Is it possible to place an object in a static position for example in a corner of the screen?
I based my app on the sceneform example from Google: https://github.com/google-ar/sceneform-android-sdk/tree/master/samples/hellosceneform. I already imported the 3D-Model I want to use. Currently the app is looking for anchors on which you can place the object. I just want to place a navigation arrow in a corner of the screen, the arrow should still be able to rotate though.
I already searched for examples or similiar questions, but couldn't find any. Thank you for your help.
...ANSWER
Answered 2019-Dec-10 at 16:38Make the 3D model a child of the camera node, by making it a child of the camera node you are forcing it's position to update relative to the camera and not an anchor. Use local rotation to rotate the model.
[update]
You can also use sceneform as part of the app's layout.xml. In the layout.xml for the view, add the SceneView as part of the view's layout.
QUESTION
I have problem with the objects generated from Google Sceneform Tools (Beta) v1.13.0 in Android Studio.
I downloaded the object (.obj file) from poly and imported to Blender to change the dimensions. After that exported again as .obj file.
When I use it to generate .sfb file in Android Studio with Sceneform tools, the .sfb object that is generated is only black.
Left is object (.obj and .mtl) imported in Blender, and right is generated .sfb file in AndroidStudio.
Thanks in advance.
EDIT: I have checked this link, but in my case .obj file starts with these lines:
...ANSWER
Answered 2019-Dec-04 at 03:02Ensure that you also export the texture (image file) that your 3D mesh requires. In my case, my sample-data
directory looks like this:
After successful conversion of the 3D model into sfa/sfb file formats, you should then check on the samplers array in the sfa
file that defines the textures your mesh is using.
Here's my end result:
QUESTION
I am trying to get the corners of the eyes like this (one here as example):
...ANSWER
Answered 2019-Nov-08 at 14:45Solution: It's not the Center pose, it's the AugmentedFaceNode from the face, which the values in the buffer given by getMeshVirtices() are relative to:
QUESTION
I'm using the Sceneform SDK in Android Project.
I have sfb
and the sfa
objects in my project, and I want the initial rotation of my object to be rotated 90 degrees.
How can I achieve it?
I found the next code in these files and I changed the scale.
But I didn't find a way for the rotation.
...ANSWER
Answered 2018-Jul-26 at 10:23Not sure if this is what you looking for but try this it looks to me nightmare though it works i have tried it somewhere at the bottom page he will explain to you how to rotate the 3dobject look for this title "Bonus: Make the heart rotate!"
QUESTION
I am bit confused how to tilt an image downwards with the help of TransformableNode in google ARCore Sceneform API. I am using google Sceneform example. I am successfully able to place contents in Screen.
Please take a look at below image how it is currently
However, I want to tilt the facebook icon downwards like earth, which is in the table. I have tried using Node and TransformableNode as stated here, but failed to do so. Can anyone tell me how to do so? Here what I have tried so far.
...ANSWER
Answered 2018-Dec-14 at 17:08Similar to set position cornerNode.setLocalPosition(localPosition);
you can set rotation cornerNode.setLocalRotation(new Quaternion(90f, 0f, 0f, -90f));
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sceneform-android-sdk
Download sceneform-android-sdk-1.16.0.zip from the Sceneform SDK [releases](https://github.com/google-ar/sceneform-android-sdk/releases/tag/v1.16.0) page.
Extract the sceneformsrc and sceneformux directories into your project’s top-level directory. The resulting directory structure should be similar to the following:
Modify your project’s settings.gradle to include the Sceneform projects:
Finally, add a reference to the Sceneform SDK to your app’s build.gradle:
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page