glu

'Ray' creation for raypicking not fully working

筅森魡賤 提交于 2019-12-11 11:42:07
问题 I'm trying to implement a 'raypicker' for selecting objects within my project. I do not fully understand how to implement this, but I understand conceptually how it should work. I've been trying to learn how to do this, but most tutorials I find go way over my head. My current code is based on one of the recent tutorials I found, here. After several hours of revisions, I believe the problem I'm having with my raypicker is actually the creation of the ray in the first place. If I substitute

Using GLU ES in Android

霸气de小男生 提交于 2019-12-10 19:51:43
问题 so I want to draw simple shapes (cylinders, spheres, and cones) in my Android app. Based on this question and answer, it seems like it is possible to port GLU into Android, which has exactly those functions I need. However, I am having trouble getting it to compile. So far I have tried the following: Download glues-1.4-bin-qnx.tar.gz from the glues download page Create a new module ("glues") in my Android project, with the include/ files from the download above and libGLUES_CM.a Include this

IllegalArgumentException from gluUnProject

怎甘沉沦 提交于 2019-12-10 17:42:20
问题 I get this error message 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): FATAL EXCEPTION: GLThread 9 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): java.lang.IllegalArgumentException: length - offset < n 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): at android.opengl.Matrix.multiplyMV(Native Method) 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): at android.opengl.GLU.gluUnProject(GLU.java:237) 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): at android.app.ui.GLSurfaceRenderer.vector3

gluPerspective code messy

ⅰ亾dé卋堺 提交于 2019-12-08 03:11:43
问题 I'm curious about gluPerspective function. I was translating the code for my engine when I saw that this function's code was messy. void glhPerspectivef2(float *matrix, float fovyInDegrees, float aspectRatio, float znear, float zfar) { float ymax, xmax; float temp, temp2, temp3, temp4; ymax = znear * tanf(fovyInDegrees * M_PI / 360.0); //ymin = -ymax; //xmin = -ymax * aspectRatio; xmax = ymax * aspectRatio; glhFrustumf2(matrix, -xmax, xmax, -ymax, ymax, znear, zfar); } Why does it create temp

How can I increase distance (zfar/gluPerspective) where openGL stops drawing objects?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 12:14:12
问题 I am learning OpenGL and having a problem with gluPerspective. Here is the code I use in Init() // Calculate The Aspect Ratio Of The Window // The parameters are: // (view angle, aspect ration of the width to the height, // The closest distance to the camera before it clips, // FOV, Ratio, The farthest distance before it stops drawing) gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000.0f); My scene works right.. but as soon as I go a little bit away from my objects they

GLU.gluLookAt in Java OpenGL bindings seems to do nothing

╄→尐↘猪︶ㄣ 提交于 2019-12-06 04:32:32
问题 I've already checked the other questions on this topic and their solutions haven't worked for me. I'm at a bit of a loss. I have the following functions in my GLEventListener implementation. public void init(GLAutoDrawable gl) { GL2 gl2 = gl.getGL().getGL2(); gl2.glMatrixMode(GL2.GL_PROJECTION); gl2.glLoadIdentity(); GLU glu = GLU.createGLU(gl2); glu.gluPerspective(45.0f, 1, 0.1f,100.0f); gl2.glMatrixMode(GL2.GL_MODELVIEW); gl2.glLoadIdentity(); gl2.glViewport(0, 0, width, height); gl2

glTexImage2D vs. gluBuild2DMipmaps

橙三吉。 提交于 2019-12-06 00:29:17
Very basic OpenGL texture creation code: int width, height; BYTE * data; FILE * file; // open texture data file = fopen( filename, "rb" ); if ( file == NULL ) return 0; // allocate buffer width = 256; height = 256; data =(BYTE*) malloc( width * height * 3 ); // read texture data fread( data, width * height * 3, 1, file ); fclose( file ); glGenTextures( 1, &texture ); glBindTexture( GL_TEXTURE_2D, texture ); //gluBuild2DMipmaps( GL_TEXTURE_2D, 3, width, height, GL_RGB, GL_UNSIGNED_BYTE, data ); glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, width, height,0, GL_RGB, GL_UNSIGNED_BYTE, data ); free( data

How can I increase distance (zfar/gluPerspective) where openGL stops drawing objects?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 20:54:11
I am learning OpenGL and having a problem with gluPerspective. Here is the code I use in Init() // Calculate The Aspect Ratio Of The Window // The parameters are: // (view angle, aspect ration of the width to the height, // The closest distance to the camera before it clips, // FOV, Ratio, The farthest distance before it stops drawing) gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000.0f); My scene works right.. but as soon as I go a little bit away from my objects they dissapear (As the red balls in image). : Web where I took graph from I understand that red balls are outside of

Can I run GLU (OpenGL) on a headless server?

我们两清 提交于 2019-12-05 16:14:50
问题 we're trying to use GLU's tesselation functions on a headless, GNU/linux server. We'd like to use PyOpenGL for that, but the problem is that it crashes on a call to gluNewTess (Segmentation fault) gdb backtrace says it's in glGetError, that makes me think that GLU tesselation needs a GL context? Or is it just some intricacy in PyOpenGL? I tried to find some information on how to initialize GL context on a headless (and virtualized) machine, no luck. Any information on these topics is

Can I run GLU (OpenGL) on a headless server?

为君一笑 提交于 2019-12-04 01:52:21
we're trying to use GLU's tesselation functions on a headless, GNU/linux server. We'd like to use PyOpenGL for that, but the problem is that it crashes on a call to gluNewTess (Segmentation fault) gdb backtrace says it's in glGetError, that makes me think that GLU tesselation needs a GL context? Or is it just some intricacy in PyOpenGL? I tried to find some information on how to initialize GL context on a headless (and virtualized) machine, no luck. Any information on these topics is appreciated. easiest: Xvfb :5 -screen 0 800x600x24 & export DISPLAY=:5 glxgears instead of glxgears, replace