public void OnNewFrame(HeadTransform transform) { Shader.Activate(); // update rotate angle. // 回転角度を更新する。 Rotate++; }
public void onNewFrame(HeadTransform headTransform) { // Build the Model part of the ModelView matrix. Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f); // Build the camera matrix and apply it to the ModelView. Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); headTransform.getHeadView(headView, 0); checkGLError("onReadyToDraw"); }
/** * Prepares OpenGL ES before we draw a frame. */ public void OnNewFrame(HeadTransform headTransform) { SetCubeRotation(); // Build the camera matrix and apply it to the ModelView. Matrix.SetLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); headTransform.GetHeadView(headView, 0); // Update the 3d audio engine with the most recent head rotation. headTransform.GetQuaternion(headRotation, 0); gvrAudioEngine.SetHeadRotation( headRotation [0], headRotation [1], headRotation [2], headRotation [3]); // Regular update call to GVR audio engine. gvrAudioEngine.Update(); CheckGLError("onReadyToDraw"); }
private void AlignStrut() { if (partner != null && strut != null) { strut.SetActive(false); var dist = Vector3.Distance(Vector3.zero, HeadTransform.InverseTransformPoint(partner.HeadTransform.position)) / 2f; var trans = strut.transform; trans.position = HeadTransform.position; trans.LookAt(partner.HeadTransform.position); trans.localScale = new Vector3(trans.position.x, trans.position.y, 1); trans.localScale = new Vector3(0.025f, dist, 0.025f); trans.Rotate(new Vector3(0, 0, 1), 90f); trans.Rotate(new Vector3(1, 0, 0), 90f); trans.Translate(new Vector3(0f, 1f, 0f) * dist); strut.SetActive(true); } }
public void OnNewFrame(HeadTransform headTransform) { GLES20.GlUseProgram(glProgram); modelViewProjectionParam = GLES20.GlGetUniformLocation(glProgram, "u_MVP"); lightPosParam = GLES20.GlGetUniformLocation(glProgram, "u_LightPos"); modelViewParam = GLES20.GlGetUniformLocation(glProgram, "u_MVMatrix"); modelParam = GLES20.GlGetUniformLocation(glProgram, "u_Model"); isFloorParam = GLES20.GlGetUniformLocation(glProgram, "u_IsFloor"); texture = GLES20.GlGetUniformLocation(glProgram, "u_texture"); // Build the Model part of the ModelView matrix. Matrix.RotateM(modelCube, 0, TimeDelta, 0.5f, 0.5f, 1.0f); // Build the camera matrix and apply it to the ModelView. Matrix.SetLookAtM(camera, 0, 0.0f, 0.0f, CameraZ, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); headTransform.GetHeadView(headView, 0); CheckGlError("onReadyToDraw"); }
public void onNewFrame(HeadTransform headTransform) { //Console.WriteLine("AndroidCardboardExperiment onNewFrame"); // Build the Model part of the ModelView matrix. Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f); // Build the camera matrix and apply it to the ModelView. Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); headTransform.getHeadView(headView, 0); checkGLError("onReadyToDraw"); }
/** * Prepares OpenGL ES before we draw a frame. */ public void OnNewFrame (HeadTransform headTransform) { SetCubeRotation (); // Build the camera matrix and apply it to the ModelView. Matrix.SetLookAtM (camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); headTransform.GetHeadView (headView, 0); // Update the 3d audio engine with the most recent head rotation. headTransform.GetQuaternion (headRotation, 0); gvrAudioEngine.SetHeadRotation ( headRotation [0], headRotation [1], headRotation [2], headRotation [3]); // Regular update call to GVR audio engine. gvrAudioEngine.Update (); CheckGLError ("onReadyToDraw"); }
private void OrientHeadTransformToTarget() { HeadTransform.LookAt(partner.HeadTransform.position); }
public void OnNewFrame(HeadTransform headTransform) { headTransform.GetHeadView(headView, 0); game.PrepareFrame(); }
public void OnNewFrame (HeadTransform headTransform) { headTransform.GetHeadView (headView, 0); game.PrepareFrame (); }