title category import { BlinnPhongMaterial , Camera , Color , DirectLight , MeshRenderer , PrimitiveMesh , Vector3 , WebGLEngine } from "oasis-engine" ; const engine = new WebGLEngine ( "canvas" ) ; engine . canvas . resizeByClientSize ( ) ; const scene = engine . sceneManager . activeScene ; const rootEntity = scene . createRootEntity ( "root" ) ; let cameraEntity = rootEntity . createChild ( "camera_entity" ) ; cameraEntity . transform . position = new Vector3 ( 0 , 5 , 10 ) ; cameraEntity . transform . lookAt ( new Vector3 ( 0 , 0 , 0 ) ) ; cameraEntity . addComponent ( Camera ) ; scene . background . solidColor . setValue ( 1 , 1 , 1 , 1 ) ; let lightEntity = rootEntity . createChild ( "light" ) ; let directLight = lightEntity . addComponent ( DirectLight ) ; directLight . color = new Color ( 1.0 , 1.0 , 1.0 ) ; directLight . intensity = 0.5 ; lightEntity . transform . rotation = new Vector3 ( 45 , 45 , 45 ) ; let cubeEntity = rootEntity . createChild ( "cube" ) ; let cube = cubeEntity . addComponent ( MeshRenderer ) ; cube . mesh = PrimitiveMesh . createCuboid ( engine , 2 , 2 , 2 ) ; cube . setMaterial ( new BlinnPhongMaterial ( engine ) ) ; engine . run ( ) ;