Skip to content

Instantly share code, notes, and snippets.

@Kashif-E
Last active December 9, 2020 11:08
Show Gist options
  • Save Kashif-E/16217978f2035969ffd8ba86f8443936 to your computer and use it in GitHub Desktop.
Save Kashif-E/16217978f2035969ffd8ba86f8443936 to your computer and use it in GitHub Desktop.
onCreate function
lateinit var link : String
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
link = "https://firebasestorage.googleapis.com/v0/b/modelviewerapp.appspot.com/o/models%2Fout.glb?alt=media&token=442d2d08-9b61-49e1-a059-e7f89a83155c"
//making a transformation system so we can interact with the 3d model
transformationSystem = TransformationSystem(resources.displayMetrics, FootprintSelectionVisualizer())
//builds the model from the link
renderObject()
//change scene view background color
SceneView.renderer?.setClearColor(Color(LTGRAY))
SceneView.scene
.addOnPeekTouchListener { hitTestResult: HitTestResult?, motionEvent: MotionEvent? ->
transformationSystem.onTouch(
hitTestResult,
motionEvent
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment