这是我为了让2D绘图工作而写的代码。活动、视图和渲染器的设置都是正确的。我得到了一个完全黑色的屏幕,但上面没有多边形。什么都没画出来。这快把我逼疯了..。
public class OpenGLActivity extends Activity {
private GLSurfaceView surfaceView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
sup
我正试着在显示器上显示一个正方形,但是我不能。我的问题是什么?如何在屏幕(屏幕中心)上显示它?
下面是我的渲染类:
public class GLRenderEx implements Renderer {
private GLCube cube;
Context c;
GLCube quad; // ( NEW )
// Constructor
public GLRenderEx(Context context) {
// Set up the data-array buffers for these shapes ( NEW )
你好,我有一个512x512的纹理,我想在我的GlSurfaceview中以100%的比例以1:1的像素显示像素视图。我在实现这一点上有困难,需要一些帮助。OnSurfaceChanged和onDrawFrame中的每种设置组合都会产生缩放图像。有没有人能给我举个例子,说明这是可能的。
private float[] mProjectionMatrix = new float[16];
// where mWidth and mHeight are set to 512
public void onSurfaceChanged(GL10 gl, int mWidth, int mHeight
我正在关注安卓开发者网站上的openGL教程,但是当我打开这个活动时,它只是一个黑色的空背景,而不是像预期的灰色GL表面。有人能告诉我我错过了什么吗?
public class OpenGLES20Activity extends Activity {
private GLSurfaceView mGLView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGLView = new M
我使用OPENGL的概念在android中创建了一些简单的动画,我要做的是在时钟方向和反时钟方向上旋转一个正方形,我的意思是对于特定的时间,正方形将分别在时钟方向和反时钟方向上旋转。
my main activity
public class main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState