Last active
December 9, 2020 11:08
-
-
Save Kashif-E/16217978f2035969ffd8ba86f8443936 to your computer and use it in GitHub Desktop.
onCreate function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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