Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Model gets re-rendered after the user moves the 3D object #138

Closed
ayasser-identity opened this issue Aug 23, 2022 · 10 comments
Closed

3D Model gets re-rendered after the user moves the 3D object #138

ayasser-identity opened this issue Aug 23, 2022 · 10 comments
Labels

Comments

@ayasser-identity
Copy link

Hi I am still new to the whole AR thing and I don't know how this framework actually work but it's great now I am facing a problem that the shape is added over and over again and it's not re-rendered upon
here is the photo of the shape :
Screenshot from 2022-08-23 15-26-08
here is the photo of the shape after trying to move it down and up :
Screenshot from 2022-08-23 15-25-34
I am doing something wrong I don't know what it is
here is the source code that I wrote :
Screenshot from 2022-08-23 15-29-02

@grassydragon
Copy link
Contributor

Hi!
Does it happen with the sample applications or on a real device? Please insert the code as a highlighted Markdown block next time.

@ayasser-identity
Copy link
Author

package com.identitysolutions.a3dmodeltrial

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.lifecycle.lifecycleScope
import io.github.sceneview.SceneView
import io.github.sceneview.ar.ArSceneView
import io.github.sceneview.ar.node.ArModelNode
import io.github.sceneview.ar.node.PlacementMode
import io.github.sceneview.math.Position
import io.github.sceneview.math.Rotation
import io.github.sceneview.math.Scale
import io.github.sceneview.node.ModelNode

const val LINK_1 = "https://test-aorist-bucket.s3.amazonaws.com/models/artwork/187.1.glb"
const val LINK_2 = "https://sceneview.github.io/assets/models/MaterialSuite.glb"

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val sceneView = findViewById<SceneView>(R.id.sceneView)
        var nodeModel = ModelNode(
            position = Position(x = 0.0f, y = 0.0f, z = 0.0f),
            rotation = Rotation(y = 90.0f),
            scale = Scale(0.5f)
        )
        sceneView.addChild(nodeModel)

        lifecycleScope.launchWhenCreated {
            nodeModel.loadModel(
                context = this@MainActivity,
                lifecycle,
                glbFileLocation = LINK_2,
                autoAnimate = false,
                centerOrigin = Position(x = 0.0f, y = 0.0f, z = 0.0f),
                onError = { exception -> Log.d("Fuck", "${exception.message}") },
            )
        }
    }
}

@ayasser-identity
Copy link
Author

well in a real device something weird screen shot happens :
Screenshot_20220823-154820

@grassydragon
Copy link
Contributor

Thank you for the report! I'll check that on my Google Pixel 3a.

@ThomasGorisse
Copy link
Contributor

Hi.
It could be a surface clearing issue.
Can you try setting an opaque background on the SceneView?

@grassydragon
Copy link
Contributor

grassydragon commented Aug 26, 2022

The sample-model-viewer application works fine on the latest main branch in my case:

Model Viewer

@nayash
Copy link

nayash commented Aug 31, 2022

Hi. It could be a surface clearing issue. Can you try setting an opaque background on the SceneView?

I have the same issue while rendering a ModelNode on SceneView. I tried white background on SceneView but couldn't see the model at all.

@lukaloens
Copy link

On Pixel 4a (5G)

Screenshot_20220920_142203

@github-actions
Copy link

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Dec 20, 2022
@github-actions
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants