先ほどのプログラムを修正して、各種パラメータを変更できるようにしました。
ソースはこちらで公開しています。
https://github.com/matsushima-terunao/android_test
apk はこちら。
https://github.com/matsushima-terunao/android_test/raw/master/opengl02/bin/opengl02.apk



fovy から a までの各トグルボタンを ON にした状態で、上部の SeekBar や +/- で値を変更できます。

GLU.gluPerspective: 視野の設定

gl.glMatrixMode(GL10.GL_PROJECTION); // 行列の選択: 射影
gl.glLoadIdentity(); // 単位行列に置き換え
GLU.gluPerspective(gl, perspectiveFovy,
 (float)width / height, perspectiveNearZ, perspectiveFarZ); // 視野の設定
まず行列の選択モードを射影にしておく必要があります。
2 fovy: y 方向の視野角
3 aspect: x : y のアスペクト比
4 nearZ: 手前のクリップ z 座標
5 farZ: 奥のクリップ z 座標
透視投影でなく並行投影を行う場合は、gl.glFrustum() を使用します。

GLU.gluLookAt: 視点の設定

gl.glMatrixMode(GL10.GL_MODELVIEW); // 行列の選択: モデルビュー
gl.glLoadIdentity(); // 単位行列に置き換え
GLU.gluLookAt(gl,
 lookAtEyeX, lookAtEyeY, lookAtEyeZ,
 lookAtCenterX, lookAtCenterY, lookAtCenterZ,
 lookAtUpperX, lookAtUpperY, lookAtUpperZ); // 視点の設定
まず行列の選択モードをモデルビューにしておく必要があります。
2-4 eyeX-Z: 視点元
5-7 centerX-Z: 視点
8-10 upX-Z: 上方向のベクトル

gl.glEnable(GL10.GL_LIGHTXXX): ライティングの有効

gl.glEnable(GL10.GL_LIGHTING); // ライティング有効
gl.glEnable(GL10.GL_LIGHT0); // ライティング0有効
第1パラメータ cap で能力を指定します。GL_LIGHTING でライティングを有効にし、さらに GL_LIGHT0-7 で 0-7 までの個別のライトを有効にします。
無効にするには gl.glDisable() を使用します。

gl.glLightfv: 光源の設定

gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_POSITION, lightPosition, 0); // 照明の位置
gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_AMBIENT, isLightAmbient ? lightAmbient : lightZero, 0); // 環境光
gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_DIFFUSE, isLightDiffuse ? lightDiffuse : lightZero, 0); // 拡散光
gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_SPECULAR, isLightSpecular ? lightSpecular : lightZero, 0); // 鏡面光
1 light: GL_LIGHT0-7 の個別のライト
2 pname: 光源の種類、3 params: 値
 GL_AMBIENT: 環境光を RGBA で指定します。初期値は 0.0, 0.0, 0.0, 1.0。
 GL_DIFFUSE: 拡散光を RGBA で指定します。初期値は GL_LIGHT0 は 1.0, 1.0, 1.0, 1.0、GL_LIGHT1-7 は 0.0, 0.0, 0.0, 1.0。
 GL_SPECULAR: 鏡面光を RGBA で指定します。初期値は GL_LIGHT0 は 1.0, 1.0, 1.0, 1.0、GL_LIGHT1-7 は 0.0, 0.0, 0.0, 1.0。
 GL_POSITION: 光源の位置を xyzw で指定します。w=0 のときは 0,0,0 から x,y,z への光源、w!=0 のときは x/w,y/w,z/w の位置からの点光源となる。初期値は 0,0,1,0。
 GL_SPOT_DIRECTION: スポットの方向を xyz で指定します。初期値は 0,0,1。
 GL_SPOT_EXPONENT: スポットの分布を 0-128 で指します定。初期値は 0。
 GL_SPOT_CUTOFF: スポットの絞りを 0-90 または 180 で指定します。初期値は 180。
 GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, GL_QUADRATIC_ATTENUATION: 定数、線形、二次の減衰率を指定します。初期値はそれぞれ 1, 0, 0。
3 offset: params のオフセット

gl.glTranslatef: 移動

gl.glTranslatef(MyRenderer.translateX, MyRenderer.translateY, MyRenderer.translateZ); // 移動
1-3 x-z: 移動ベクトル

gl.glRotatef: 回転

gl.glRotatef(MyRenderer.rotateX, 1, 0, 0); // 回転: x軸
gl.glRotatef(MyRenderer.rotateY, 0, 1, 0); // 回転: y軸
gl.glRotatef(MyRenderer.rotateZ, 0, 0, 1); // 回転: z軸
1 angle: 回転角度
2-4 x-z: 回転ベクトル

gl.glNormalPointer: 面法線の指定

gl.glNormal3f(normalVectors[face * 3 + 0], normalVectors[face * 3 + 1], normalVectors[face * 3 + 2]); // 面法線ベクトル
1-3 x-z: 法線ベクトル

gl.glNormalPointer: 頂点法線の指定

gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); // 法線配列を有効
gl.glNormalPointer(GL10.GL_FLOAT, 0, vertexBuffer); // xyz, float, padding なし, vertexBuffer
まず法線配列を有効にしておく必要があります。
1 type: pointer の配列型
2 stride: pointer 内の座標間のパディング
3 pointer: 座標配列
法線配列を無効にするには gl.glDisableClientState(GL10.GL_NORMAL_ARRAY) を使用します。


MainActivity.java

package com.example.sample;

import java.util.LinkedList;

import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.ToggleButton;

public class MainActivity extends Activity {

	/** ビュー */
	private MyView view;

	private static final int FP = LinearLayout.LayoutParams.FILL_PARENT;
	//private static final int WC = LinearLayout.LayoutParams.WRAP_CONTENT;

	private interface SetValue<T> {
		public void setValue(T value);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main); // アクティビティーにビューを設定
		// myView
		this.view = new MyView(this);
		((LinearLayout)findViewById(R.id.layout)).addView(this.view, new LinearLayout.LayoutParams(FP, FP));
		// optionLayout
		LinkedList<ToggleButton> toggleButtons = new LinkedList<ToggleButton>();
		initOptionView(toggleButtons, R.id.toggleButtonPerspectiveFovy, R.id.editTextPerspectiveFovy, MyRenderer.perspectiveFovy, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.perspectiveFovy = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonPerspectiveNearZ, R.id.editTextPerspectiveNearZ, MyRenderer.perspectiveNearZ, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.perspectiveNearZ = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonPerspectiveFarZ, R.id.editTextPerspectiveFarZ, MyRenderer.perspectiveFarZ, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.perspectiveFarZ = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtEyeX, R.id.editTextLookAtEyeX, MyRenderer.lookAtEyeX, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtEyeX = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtEyeY, R.id.editTextLookAtEyeY, MyRenderer.lookAtEyeY, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtEyeY = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtEyeZ, R.id.editTextLookAtEyeZ, MyRenderer.lookAtEyeZ, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtEyeZ = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtCenterX, R.id.editTextLookAtCenterX, MyRenderer.lookAtCenterX, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtCenterX = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtCenterY, R.id.editTextLookAtCenterY, MyRenderer.lookAtCenterY, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtCenterY = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtCenterZ, R.id.editTextLookAtCenterZ, MyRenderer.lookAtCenterZ, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtCenterZ = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtUpperX, R.id.editTextLookAtUpperX, MyRenderer.lookAtUpperX, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtUpperX = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtUpperY, R.id.editTextLookAtUpperY, MyRenderer.lookAtUpperY, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtUpperY = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLookAtUpperZ, R.id.editTextLookAtUpperZ, MyRenderer.lookAtUpperZ, 100, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lookAtUpperZ = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonTranslateX, R.id.editTextTranslateX, MyRenderer.translateX, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.translateX = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonTranslateY, R.id.editTextTranslateY, MyRenderer.translateY, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.translateY = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonTranslateZ, R.id.editTextTranslateZ, MyRenderer.translateZ, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.translateZ = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonRotateX, R.id.editTextRotateX, MyRenderer.rotateX, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.rotateX = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonRotateY, R.id.editTextRotateY, MyRenderer.rotateY, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.rotateY = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonRotateZ, R.id.editTextRotateZ, MyRenderer.rotateZ, 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.rotateZ = value; }});
		initOptionCompoundButton(R.id.checkBoxLightPosition, MyRenderer.isLightPosition, new SetValue<Boolean>() { public void setValue(Boolean value) { MyRenderer.isLightPosition = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightPositionX, R.id.editTextLightPositionX, MyRenderer.lightPosition[0], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightPosition[0] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightPositionY, R.id.editTextLightPositionY, MyRenderer.lightPosition[1], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightPosition[1] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightPositionZ, R.id.editTextLightPositionZ, MyRenderer.lightPosition[2], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightPosition[2] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightPositionW, R.id.editTextLightPositionW, MyRenderer.lightPosition[3], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightPosition[3] = value; }});
		initOptionCompoundButton(R.id.checkBoxLightAmbient, MyRenderer.isLightAmbient, new SetValue<Boolean>() { public void setValue(Boolean value) { MyRenderer.isLightAmbient = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightAmbientR, R.id.editTextLightAmbientR, MyRenderer.lightAmbient[0], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightAmbient[0] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightAmbientG, R.id.editTextLightAmbientG, MyRenderer.lightAmbient[1], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightAmbient[1] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightAmbientB, R.id.editTextLightAmbientB, MyRenderer.lightAmbient[2], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightAmbient[2] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightAmbientA, R.id.editTextLightAmbientA, MyRenderer.lightAmbient[3], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightAmbient[3] = value; }});
		initOptionCompoundButton(R.id.checkBoxLightDiffuse, MyRenderer.isLightDiffuse, new SetValue<Boolean>() { public void setValue(Boolean value) { MyRenderer.isLightDiffuse = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightDiffuseR, R.id.editTextLightDiffuseR, MyRenderer.lightDiffuse[0], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightDiffuse[0] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightDiffuseG, R.id.editTextLightDiffuseG, MyRenderer.lightDiffuse[1], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightDiffuse[1] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightDiffuseB, R.id.editTextLightDiffuseB, MyRenderer.lightDiffuse[2], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightDiffuse[2] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightDiffuseA, R.id.editTextLightDiffuseA, MyRenderer.lightDiffuse[3], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightDiffuse[3] = value; }});
		initOptionCompoundButton(R.id.checkBoxLightSpecular, MyRenderer.isLightSpecular, new SetValue<Boolean>() { public void setValue(Boolean value) { MyRenderer.isLightSpecular = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightSpecularR, R.id.editTextLightSpecularR, MyRenderer.lightSpecular[0], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightSpecular[0] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightSpecularG, R.id.editTextLightSpecularG, MyRenderer.lightSpecular[1], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightSpecular[1] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightSpecularB, R.id.editTextLightSpecularB, MyRenderer.lightSpecular[2], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightSpecular[2] = value; }});
		initOptionView(toggleButtons, R.id.toggleButtonLightSpecularA, R.id.editTextLightSpecularA, MyRenderer.lightSpecular[3], 1, new SetValue<Float>() { public void setValue(Float value) { MyRenderer.lightSpecular[3] = value; }});
		initOptionCompoundButton(R.id.radioPlaneNormal, MyRenderer.planeNormal, new SetValue<Boolean>() { public void setValue(Boolean value) { MyRenderer.planeNormal = value; }});
		initOptionCompoundButton(R.id.radioVertexNormal, MyRenderer.vertexNormal, new SetValue<Boolean>() { public void setValue(Boolean value) { MyRenderer.vertexNormal = value; }});
		// seekBar -> editText
		((SeekBar)findViewById(R.id.seekBarCommon)).setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
			@Override
			public void onStopTrackingTouch(SeekBar seekBar) {
			}
			@Override
			public void onStartTrackingTouch(SeekBar seekBar) {
			}
			@Override
			public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
				Object[] tag = (Object[])seekBar.getTag();
				if (null != tag) {
					float value = (progress - seekBar.getMax() / 2) / (Float)tag[1];
					((EditText)tag[0]).setText("" + value);
				}
			}
		});
		// buttonSeekBarDec
		findViewById(R.id.buttonSeekBarDec).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				((SeekBar)findViewById(R.id.seekBarCommon)).setProgress(((SeekBar)findViewById(R.id.seekBarCommon)).getProgress() - 1);
			}
		});
		// buttonSeekBarInc
		findViewById(R.id.buttonSeekBarInc).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				((SeekBar)findViewById(R.id.seekBarCommon)).setProgress(((SeekBar)findViewById(R.id.seekBarCommon)).getProgress() + 1);
			}
		});
		// buttonOption
		findViewById(R.id.buttonOption).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				findViewById(R.id.optionLayout).setLayoutParams(new LinearLayout.LayoutParams(FP,
						0 == findViewById(R.id.optionLayout).getHeight() ? LinearLayout.LayoutParams.WRAP_CONTENT : 0));
			}
		});
		//findViewById(R.id.optionLayout).setLayoutParams(new LinearLayout.LayoutParams(FP, 0));
	}

	@Override
	protected void onResume() {
		super.onResume();
		view.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
		view.onPause();
	}

	/**
	 * option 項目の初期化。
	 * 
	 * @param toggleButtons
	 * @param idToggleButton
	 * @param idEditText
	 * @param value
	 * @param unit
	 * @param setValue
	 */
	private void initOptionView(final LinkedList<ToggleButton> toggleButtons, final int idToggleButton, final int idEditText, float value, final float unit, final SetValue<Float> setValue) {
		final ToggleButton toggleButton = (ToggleButton)findViewById(idToggleButton);
		final EditText editText = (EditText)findViewById(idEditText);
		final SeekBar seekBar = (SeekBar)findViewById(R.id.seekBarCommon);
		editText.setText("" + value);
		// toggleButton
		toggleButtons.add(toggleButton);
		toggleButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			@Override
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				if (isChecked) {
					// ほかを off
					for (ToggleButton t: toggleButtons) {
						if (t != buttonView) {
							t.setChecked(false);
						}
					}
					// seekBar を editText に関連付け
					try {
						seekBar.setTag(new Object[] {editText, unit});
						float value = Float.parseFloat(editText.getText().toString());
						seekBar.setProgress((int)(value * unit + seekBar.getMax() / 2));
					} catch (Exception e) {
					}
				}
			}
		});
		// editText -> seekBar, variable
		editText.addTextChangedListener(new TextWatcher() {
			@Override
			public void onTextChanged(CharSequence s, int start, int before, int count) {
				try {
					float value = Float.parseFloat(s.toString());
					seekBar.setProgress((int)(value * unit + seekBar.getMax() / 2));
					setValue.setValue(value);
					System.out.println(s);
					MyRenderer.optionChanged = true;
				} catch (Exception e) {
				}
			}
			@Override
			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
			}
			@Override
			public void afterTextChanged(Editable s) {
			}
		});
		// editText -> toggleButton
		editText.setOnFocusChangeListener(new OnFocusChangeListener() {
			@Override
			public void onFocusChange(View v, boolean hasFocus) {
				if (hasFocus) {
					toggleButton.setChecked(true);
				}
			}
		});
	}

	/**
	 * CompoundButton の初期化。
	 * 
	 * @param idCompoundButton
	 * @param value
	 * @param setValue
	 */
	private void initOptionCompoundButton(int idCompoundButton, boolean value, final SetValue<Boolean> setValue) {
		CompoundButton checkBox = (CompoundButton)findViewById(idCompoundButton);
		checkBox.setChecked(value);
		checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			@Override
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				setValue.setValue(isChecked);
				MyRenderer.optionChanged =  true;
			}
		});
		
	}
}

MyView.java

package com.example.sample;

import android.content.Context;
import android.opengl.GLSurfaceView;

public class MyView extends GLSurfaceView {

	public MyRenderer renderer;

	public MyView(Context context) {
		super(context);
		renderer = new MyRenderer();
		setRenderer(renderer); // レンダラーの設定
	}
}

MyRenderer.java

package com.example.sample;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.opengl.GLSurfaceView.Renderer;
import android.opengl.GLU;

public class MyRenderer implements Renderer {

	/** モデル */
	private MyModel model = new MyModel();

	/** ビューポート */
	private int width, height;

	// option
	/** 視野 */
	public static float perspectiveFovy = 45, perspectiveNearZ = 1, perspectiveFarZ = 100;
	/** 視点 */
	public static float lookAtEyeX = 0, lookAtEyeY = 0, lookAtEyeZ = 0;
	/** 視点 */
	public static float lookAtCenterX = 0, lookAtCenterY = 0, lookAtCenterZ = -1;
	/** 視点 */
	public static float lookAtUpperX = 0, lookAtUpperY = 1, lookAtUpperZ = 0;
	/** 移動 */
	public static float translateX = 0, translateY = 0, translateZ = -10;
	/** 回転 */
	public static float rotateX = 30, rotateY = 30, rotateZ = 0;
	/** 照明の位置 */
	public static boolean isLightPosition = true;
	/** 照明の位置 */
	public static float[] lightPosition = {-20.0f, 20.0f, 100.0f, 1.0f};
	/** 環境光 */
	public static boolean isLightAmbient = true;
	/** 環境光 */
	public static float[] lightAmbient = {0.0f, 0.5f, 0.0f, 1.0f};
	/** 拡散光 */
	public static boolean isLightDiffuse = true;
	/** 拡散光 */
	public static float[] lightDiffuse = {1.0f, 0.0f, 0.0f, 1.0f};
	/** 鏡面光 */
	public static boolean isLightSpecular = true;
	/** 鏡面光 */
	public static float[] lightSpecular = {0.0f, 0.0f, 1.0f, 1.0f};
	/** 光無効 */
	public static float[] lightZero = {0, 0, 0, 0};
	/** 面法線 */
	public static boolean planeNormal = true;
	/** 頂点法線 */
	public static boolean vertexNormal = false;
	/** option が変更された */
	public static volatile boolean optionChanged = false;

	@Override
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		gl.glEnable(GL10.GL_DEPTH_TEST); // デプスバッファを有効
		gl.glDepthFunc(GL10.GL_LEQUAL); // デプスバッファ比較: 以下
		if (isLightPosition) {
			gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_POSITION, lightPosition, 0); // 照明の位置
			gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_AMBIENT, isLightAmbient ? lightAmbient : lightZero, 0); // 環境光
			gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_DIFFUSE, isLightDiffuse ? lightDiffuse : lightZero, 0); // 拡散光
			gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_SPECULAR, isLightSpecular ? lightSpecular : lightZero, 0); // 鏡面光
			gl.glEnable(GL10.GL_LIGHTING); // ライティング有効
			gl.glEnable(GL10.GL_LIGHT0); // ライティング0有効
		}
	}

	@Override
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		this.width = width;
		this.height = height;
		gl.glViewport(0, 0, width, height); // ビューポートの設定
		gl.glMatrixMode(GL10.GL_PROJECTION); // 行列の選択: 射影
		gl.glLoadIdentity(); // 単位行列に置き換え
		GLU.gluPerspective(gl, perspectiveFovy, (float)width / height, perspectiveNearZ, perspectiveFarZ); // 視野の設定
		gl.glMatrixMode(GL10.GL_MODELVIEW); // 行列の選択: モデルビュー
		gl.glLoadIdentity(); // 単位行列に置き換え
		GLU.gluLookAt(gl, lookAtEyeX, lookAtEyeY, lookAtEyeZ, lookAtCenterX, lookAtCenterY, lookAtCenterZ, lookAtUpperX, lookAtUpperY, lookAtUpperZ); // 視点の設定
	}

	@Override
	public void onDrawFrame(GL10 gl) {
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); // バッファクリア: カラーバッファ, デプスバッファ
		if (optionChanged) {
			optionChanged = false;
			gl.glMatrixMode(GL10.GL_PROJECTION); // 行列の選択: 射影
			gl.glLoadIdentity(); // 単位行列に置き換え
			GLU.gluPerspective(gl, perspectiveFovy, (float)width / height, perspectiveNearZ, perspectiveFarZ); // 視野の設定
			gl.glMatrixMode(GL10.GL_MODELVIEW); // 行列の選択: モデルビュー
			gl.glLoadIdentity(); // 単位行列に置き換え
			GLU.gluLookAt(gl, lookAtEyeX, lookAtEyeY, lookAtEyeZ, lookAtCenterX, lookAtCenterY, lookAtCenterZ, lookAtUpperX, lookAtUpperY, lookAtUpperZ); // 視点の設定
			if (isLightPosition) {
				gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_POSITION, lightPosition, 0); // 照明の位置
				gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_AMBIENT, isLightAmbient ? lightAmbient : lightZero, 0); // 環境光
				gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_DIFFUSE, isLightDiffuse ? lightDiffuse : lightZero, 0); // 拡散光
				gl.glLightfv(GL10.GL_LIGHT0,  GL10.GL_SPECULAR, isLightSpecular ? lightSpecular : lightZero, 0); // 鏡面光
				gl.glEnable(GL10.GL_LIGHTING); // ライティング有効
				gl.glEnable(GL10.GL_LIGHT0); // ライティング0有効
			} else {
				gl.glDisable(GL10.GL_LIGHTING); // ライティング無効
				gl.glDisable(GL10.GL_LIGHT0); // ライティング0無効
			}
		}
		model.draw(gl);
	}
}

MyModel.java

package com.example.sample;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

import javax.microedition.khronos.opengles.GL10;

public class MyModel {

	/** プリミティブの頂点座標 */
	private static final float[] vertices = {
		// front
		-1.0f, -1.0f,  1.0f,
		 1.0f, -1.0f,  1.0f,
		-1.0f,  1.0f,  1.0f,
		 1.0f,  1.0f,  1.0f,
		// back
		 1.0f, -1.0f, -1.0f,
		-1.0f, -1.0f, -1.0f,
		 1.0f,  1.0f, -1.0f,
		-1.0f,  1.0f, -1.0f,
		// left
		-1.0f, -1.0f, -1.0f,
		-1.0f, -1.0f,  1.0f,
		-1.0f,  1.0f, -1.0f,
		-1.0f,  1.0f,  1.0f,
		// right
		 1.0f, -1.0f,  1.0f,
		 1.0f, -1.0f, -1.0f,
		 1.0f,  1.0f,  1.0f,
		 1.0f,  1.0f, -1.0f,
		// top
		-1.0f,  1.0f,  1.0f,
		 1.0f,  1.0f,  1.0f,
		-1.0f,  1.0f, -1.0f,
		 1.0f,  1.0f, -1.0f,
		// bottom
		-1.0f, -1.0f, -1.0f,
		 1.0f, -1.0f, -1.0f,
		-1.0f, -1.0f,  1.0f,
		 1.0f, -1.0f,  1.0f,
	};

	/** 頂点バッファ */
	private static FloatBuffer vertexBuffer;
	/** 面法線ベクトル */
	private static float[] normalVectors;

	/**
	 * モデルを構築。
	 */
	public MyModel() {
		// 頂点定義の FloatBuffer を作成
		ByteBuffer buf = ByteBuffer.allocateDirect(vertices.length * 4);
		buf.order(ByteOrder.nativeOrder());
		vertexBuffer = buf.asFloatBuffer();
		vertexBuffer.put(vertices);
		vertexBuffer.position(0);
		// 面法線ベクトル
		normalVectors = new float[6 * 3];
		for (int face = 0; face < 6; ++ face) {
			float vx1 = vertices[(face * 4 + 1) * 3 + 0] - vertices[face * 4 * 3 + 0];
			float vx2 = vertices[(face * 4 + 2) * 3 + 0] - vertices[face * 4 * 3 + 0];
			float vy1 = vertices[(face * 4 + 1) * 3 + 1] - vertices[face * 4 * 3 + 1];
			float vy2 = vertices[(face * 4 + 2) * 3 + 1] - vertices[face * 4 * 3 + 1];
			float vz1 = vertices[(face * 4 + 1) * 3 + 2] - vertices[face * 4 * 3 + 2];
			float vz2 = vertices[(face * 4 + 2) * 3 + 2] - vertices[face * 4 * 3 + 2];
			float nx = vy1 * vz2 - vy2 * vz1;
			float ny = vz1 * vx2 - vz2 * vx1;
			float nz = vx1 * vy2 - vx2 * vy1;
			float nr = (float)Math.sqrt(nx * nx + ny * ny + nz * nz);
			normalVectors[face * 3 + 0] = nx / nr;
			normalVectors[face * 3 + 1] = ny / nr;
			normalVectors[face * 3 + 2] = nz / nr;
		}
	}

	/**
	 * モデルを描画。
	 * 
	 * @param gl
	 */
	public void draw(GL10 gl) {
		gl.glPushMatrix();
		gl.glTranslatef(MyRenderer.translateX, MyRenderer.translateY, MyRenderer.translateZ); // 移動
		gl.glRotatef(MyRenderer.rotateX, 1, 0, 0); // 回転: x軸
		gl.glRotatef(MyRenderer.rotateY, 0, 1, 0); // 回転: y軸
		gl.glRotatef(MyRenderer.rotateZ, 0, 0, 1); // 回転: z軸
		gl.glFrontFace(GL10.GL_CCW); // 全面: 反時計回り
		gl.glEnable(GL10.GL_CULL_FACE); // 片面を表示しない
		gl.glCullFace(GL10.GL_BACK); // 裏面を表示しない
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); // 頂点配列を有効
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); // xyz, float, padding なし, vertexBuffer
		if (MyRenderer.vertexNormal) {
			gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); // 法線配列を有効
			gl.glNormalPointer(GL10.GL_FLOAT, 0, vertexBuffer); // xyz, float, padding なし, vertexBuffer
		} else {
			gl.glDisableClientState(GL10.GL_NORMAL_ARRAY); // 法線配列を無効
		}
		for (int face = 0; face < 6; ++ face) {
			if (MyRenderer.planeNormal) {
				gl.glNormal3f(normalVectors[face * 3 + 0], normalVectors[face * 3 + 1], normalVectors[face * 3 + 2]); // 面法線ベクトル
			}
			gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, face * 4, 4); // 0120 1231 // プリミティブを描画
		}
		gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); // 頂点配列を無効
		gl.glDisable(GL10.GL_CULL_FACE); // 片面を表示しないを無効
		gl.glPopMatrix();
	}
}

activity_main.xml

<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="0dp"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.sample.MainActivity" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_margin="0dp"
        android:orientation="vertical"
        android:padding="0dp" >

        <LinearLayout
            android:id="@+id/layout"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_weight="100"
            android:orientation="vertical" >
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" >

            <Button
                android:id="@+id/buttonOption"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:minHeight="48dp"
                android:text="option">

                <requestFocus />
            </Button>
            
            <Button
                android:id="@+id/buttonSeekBarDec"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:text="-" />

            <SeekBar
                android:id="@+id/seekBarCommon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|fill_horizontal"
                android:layout_weight="1"
                android:max="300" />

            <Button
                android:id="@+id/buttonSeekBarInc"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:text="+" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/optionLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TextView
                    android:id="@+id/TextView10"
                    android:layout_width="50dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="perspective"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonPerspectiveFovy"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="fovy"
                    android:textOff="fovy"
                    android:textOn="fovy"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextPerspectiveFovy"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonPerspectiveNearZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="nearZ"
                    android:textOff="nearZ"
                    android:textOn="nearZ"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextPerspectiveNearZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonPerspectiveFarZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="farZ"
                    android:textOff="farZ"
                    android:textOn="farZ"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextPerspectiveFarZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0" >

                <TextView
                    android:id="@+id/TextView20"
                    android:layout_width="50dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="lookAt eye"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtEyeX"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="x"
                    android:textOff="x"
                    android:textOn="x"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtEyeX"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtEyeY"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="y"
                    android:textOff="y"
                    android:textOn="y"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtEyeY"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtEyeZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="z"
                    android:textOff="z"
                    android:textOn="z"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtEyeZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TextView
                    android:id="@+id/TextView19"
                    android:layout_width="50dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="lookAt center"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtCenterX"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="x"
                    android:textOff="x"
                    android:textOn="x"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtCenterX"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtCenterY"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="y"
                    android:textOff="y"
                    android:textOn="y"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtCenterY"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtCenterZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="z"
                    android:textOff="z"
                    android:textOn="z"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtCenterZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TextView
                    android:id="@+id/TextView18"
                    android:layout_width="50dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="lookAt upper"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtUpperX"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="x"
                    android:textOff="x"
                    android:textOn="x"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtUpperX"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtUpperY"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="y"
                    android:textOff="y"
                    android:textOn="y"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtUpperY"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLookAtUpperZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="z"
                    android:textOff="z"
                    android:textOn="z"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLookAtUpperZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TextView
                    android:id="@+id/TextView16"
                    android:layout_width="50dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="translate"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonTranslateX"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="x"
                    android:textOff="x"
                    android:textOn="x"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextTranslateX"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonTranslateY"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="y"
                    android:textOff="y"
                    android:textOn="y"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextTranslateY"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonTranslateZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="z"
                    android:textOff="z"
                    android:textOn="z"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextTranslateZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <TextView
                    android:id="@+id/TextView01"
                    android:layout_width="50dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="rotate"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonRotateX"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="x"
                    android:textOff="x"
                    android:textOn="x"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextRotateX"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonRotateY"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="y"
                    android:textOff="y"
                    android:textOn="y"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextRotateY"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonRotateZ"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="z"
                    android:textOff="z"
                    android:textOn="z"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextRotateZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <CheckBox
                    android:id="@+id/checkBoxLightPosition"
                    android:layout_width="70dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="lighting"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightPositionX"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="x"
                    android:textOff="x"
                    android:textOn="x"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightPositionX"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightPositionY"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="y"
                    android:textOff="y"
                    android:textOn="y"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightPositionY"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightPositionZ"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="z"
                    android:textOff="z"
                    android:textOn="z"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightPositionZ"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightPositionW"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="w"
                    android:textOff="w"
                    android:textOn="w"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightPositionW"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <CheckBox
                    android:id="@+id/checkBoxLightAmbient"
                    android:layout_width="70dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="ambient"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightAmbientR"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="r"
                    android:textOff="r"
                    android:textOn="r"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightAmbientR"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightAmbientG"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="g"
                    android:textOff="g"
                    android:textOn="g"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightAmbientG"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightAmbientB"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="b"
                    android:textOff="b"
                    android:textOn="b"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightAmbientB"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightAmbientA"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="a"
                    android:textOff="a"
                    android:textOn="a"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightAmbientA"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <CheckBox
                    android:id="@+id/checkBoxLightDiffuse"
                    android:layout_width="70dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="diffuse"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightDiffuseR"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="r"
                    android:textOff="r"
                    android:textOn="r"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightDiffuseR"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightDiffuseG"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="g"
                    android:textOff="g"
                    android:textOn="g"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightDiffuseG"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightDiffuseB"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="b"
                    android:textOff="b"
                    android:textOn="b"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightDiffuseB"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightDiffuseA"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="a"
                    android:textOff="a"
                    android:textOn="a"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightDiffuseA"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <CheckBox
                    android:id="@+id/checkBoxLightSpecular"
                    android:layout_width="70dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:text="specular"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightSpecularR"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="r"
                    android:textOff="r"
                    android:textOn="r"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightSpecularR"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightSpecularG"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="g"
                    android:textOff="g"
                    android:textOn="g"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightSpecularG"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightSpecularB"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="b"
                    android:textOff="b"
                    android:textOn="b"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightSpecularB"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />

                <ToggleButton
                    android:id="@+id/toggleButtonLightSpecularA"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_weight="0"
                    android:text="a"
                    android:textOff="a"
                    android:textOn="a"
                    android:textSize="8sp" />

                <EditText
                    android:id="@+id/editTextLightSpecularA"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="numberDecimal"
                    android:textSize="8sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1" >

                <RadioGroup
                    android:id="@+id/radioGroup1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="horizontal" >

                    <RadioButton
                        android:id="@+id/radioPlaneNormal"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="面法線"
                        android:textSize="8sp" />

                    <RadioButton
                        android:id="@+id/radioVertexNormal"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:checked="true"
                        android:text="頂点法線"
                        android:textSize="8sp" />

                </RadioGroup>

            </LinearLayout>

        </LinearLayout>
    </LinearLayout>

</RelativeLayout>

→ 1-5. Andriod + OpenGL でゲームを作ってみる
← 1-3. Android で OpenGL
↑ 一覧