コミットしました。
1 parent fdd1477 commit 668bf013c82eacf05794fa1076fce91cc5952d8e
t-kume authored on 10 Dec 2019
Showing 3 changed files
View
11
app/src/main/java/com/google/ar/core/examples/java/common/framework/RWT/RWTRenderer.java
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();
View
2
■■■
app/src/main/java/com/google/ar/core/examples/java/common/framework/view3D/Viewer3D.java
public void onDrawFrame() {
// Position3D eye = camera.getViewPoint();
// Position3D center = eye.clone().add(camera.getViewLine());
// Vector3d up = camera.getViewUp();
gc3D.update((float)camera.getFieldOfView(), (float)camera.getFrontClipDistance(), (float)camera.getBackClipDistance(), eye, center, up, camera.isParallel());
// gc3D.update((float)camera.getFieldOfView(), (float)camera.getFrontClipDistance(), (float)camera.getBackClipDistance(), eye, center, up, camera.isParallel());
}
@Override
public void update(ArrayList<Light> lights, BackgroundBox skyBox) {
View
app/src/main/java/com/google/ar/core/examples/java/helloar/HelloArActivity.java