| |
---|
| | protected HelloArActivity helloArActivity; |
---|
| | protected Universe universe; |
---|
| | protected GraphicsContext3D gc3D = null; |
---|
| | |
---|
| | public RWTRenderer(HelloArActivity helloArActivity, BackgroundRenderer backgroundRenderer) { |
---|
| | public RWTRenderer(HelloArActivity helloArActivity, BackgroundRenderer backgroundRenderer, Universe universe) { |
---|
| | super(); |
---|
| | this.universe = universe; |
---|
| | this.helloArActivity = helloArActivity; |
---|
| | this.backgroundRenderer = backgroundRenderer; |
---|
| | } |
---|
| | |
---|
| |
---|
| | |
---|
| | @Override |
---|
| | public void onSurfaceCreated(GL10 gl, EGLConfig config) { |
---|
| | // gc3D = new GraphicsContext3D(gl); |
---|
| | // ArrayList<Light> lights = camera.getUniverse().getLights(); |
---|
| | // ArrayList<Light> lights = universe.getLights(); |
---|
| | // for (int i = 0; i < lights.size(); i++){ |
---|
| | // Light l = lights.get(i); |
---|
| | // gc3D.setLight(l,i); |
---|
| | // } |
---|
| |
---|
| | } else { |
---|
| | viewer.setGraphicsContext3D(gc3D.setGL10(gl)); |
---|
| | } |
---|
| | viewer.onDrawFrame(); |
---|
| | // |
---|
| | // // 3Dモデルのレンダリング |
---|
| | |
---|
| | // 3Dモデルのレンダリング |
---|
| | // gc3D.pushMatrix(); |
---|
| | // universe.render(viewer); |
---|
| | universe.render(viewer); |
---|
| | // gc3D.popMatrix(); |
---|
| | helloArActivity.onDrawFrame(gl, frame, camera); |
---|
| | } catch (CameraNotAvailableException e) { |
---|
| | e.printStackTrace(); |
---|
| | |