Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About hury

  • Rank
  1. hury

    OpenGL Thread Problem

    Hmm that would result in loosing all the graphics drawn from the first thread :( How would you solve scrolling text without locking out the main application? I thought about drawing the text in its own thread, but it doesnt seem to be the correct solution
  2. Hi, I´ve got a strange problem with text output: [cpp] // String auf OpenGL Fenster ausgeben void drawString (char *s, bool animatedText) { // draw static text ... if (!animatedText) { // WORKS glutBitmapCharacter (GLUT_BITMAP_HELVETICA_10, (char)'.'); } // draw moving text ... if (animatedText) { //DOESNT WORK CreateThread(0, 0, TextFred, NULL, 0, 0); } }[/cpp] [cpp] // Timer Thread DWORD WINAPI TextFred(LPVOID ptr) { glutBitmapCharacter (GLUT_BITMAP_HELVETICA_10, (char)'A'); return 0; } [/cpp] "Normal" (first) output works fine. But the output in the thread doesnt show anything. Anyone any clue why?
  3. hury

    OpenGL Better 3D Feeling

    Hi, yeah, its absolutely clear, that there is no algorithm, i´m just searching for ideas what one could do here. I´m note sure what you mean with >> You could try putting the icons into translucent 3d spheres for some kind of 3d effect. <<. Could you explain? Why should this get a 3d effect?
  4. Hi, i am redrawing the Desktop in OpenGL in a Cube: www.captured-dreams.de/temp/screen.jpg For the textures of the Icons I read the icon data from each file. It works, but somehow the Files dont really look like 3-D. Anyone any ideas, how to make them feel more 3d? I tried converting them to spheres, but the standart icon textures do not really work as sphere textures. It looks horrible then.
  5. hury

    Camera movement issue

    Hi, yes I mean getting closer to the scene. My problem is that i´m getting closer to the cube, which is drawn in cube.draw, but the icons, which are drawn in DrawItems() stay at the same distance from the camera. So when i move camera into the scene, the icons step away from the camera.
  6. hury

    Camera movement issue

    Hi, i tried your suggestions, but no success - nothing changed. Cube.draw: void Cube::draw() { glLineStipple(2, (short) 0x00FF); glEnable(GL_LINE_STIPPLE); glBegin(GL_LINES); glColor3f(0.4f,0.69f,1.0f); //Blau glVertex3f(-2.5, -2.0, 0.0); //Links unten horizontal glVertex3f(-2.5, -2.0, -3.0); glVertex3f(-2.5, -2.0, -3.0); //Hinten unten horizontal glVertex3f(2.5, -2.0, -3.0); glVertex3f(2.5, -2.0, -3.0); //Rechts unten horizontal glVertex3f(2.5, -2.0, 0.0); glVertex3f(2.5, -2.0, 0.0); //Rechts vorne vertikal glVertex3f(2.5, 2.0, 0.0); glVertex3f(2.5, 2.0, 0.0); //Rechts oben horizontal glVertex3f(2.5, 2.0, -3.0); glVertex3f(2.5, 2.0, -3.0); //Rechts hinten vertikal glVertex3f(2.5, -2.0, -3.0); glVertex3f(2.5, 2.0, -3.0); //Hinten oben horizontal glVertex3f(-2.5, 2.0, -3.0); glVertex3f(-2.5, 2.0, -3.0); //Hinten links vertikal glVertex3f(-2.5, -2.0, -3.0); glVertex3f(-2.5, -2.0, 0.0); //Vorne unten horizontal glVertex3f(2.5, -2.0, 0.0); glVertex3f(-2.5, -2.0, 0.0); //Vorne links vertikal glVertex3f(-2.5, 2.0, 0.0); glVertex3f(-2.5, 2.0, 0.0); //Oben links horizontal glVertex3f(-2.5, 2.0, -3.0); glVertex3f(-2.5, 2.0, 0.0); //Vorne oben horizontal glVertex3f(2.5, 2.0, 0.0); glEnd(); glDisable(GL_LINE_STIPPLE); } ------------------------------------------ DrawItems(): void DrawItems() { glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // Set position glTranslatef(x , y, z); // Draw all icons in the vector for(int i=0; i < myIcons.getIconVectorALL().size(); i++) { glLoadIdentity(); glPushMatrix(); glBegin(GL_QUADS); // Quad glTexCoord2f(0, 0); glVertex3f(-0.08f, 0.08f, 0.02f); glTexCoord2f(0, 1); glVertex3f(-0.08f,-0.08f, 0.02f); glTexCoord2f(1, 1); glVertex3f( 0.08f,-0.08f, 0.02f); glTexCoord2f(1, 0); glVertex3f( 0.08f, 0.08f, 0.02f); glEnd(); glPopMatrix(); } How would you zoom into the scene?
  7. Hi, i have a strange bug, that i dont understand. In order to explain, i attach 2 screenshots: http://www.captured-dreams.de/temp/screen1.jpg http://www.captured-dreams.de/temp/screen2.jpg On screen 1 you see the startup look. Now i try zooming into the scene by adjusting the zeye value: zeye--; here is my display() function: void display ( void ) // Create The Display Function { // Clear Screen And Depth Buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); gluLookAt (xeye, yeye, zeye, xfocus, yfocus, zfocus, 0,1,0); // Draw the Cube myCube.draw(); // Draw the items DrawItems(); glutSwapBuffers(); // Swap The Buffers To Not Be Left With A Clear Screen } As you see the camera zooms into the cube, but the icons have somehow moved. They dont keep their old position. I cant figure out why. Any ideas?
  8. Yes, thats correct...But how can i change the alpha value of an texture?
  9. Hi Brother Bob, I have quad-objects which are covered with textures. Now when i move one of these objects in the z-Axis, it´s Alpha value should be set to an lower value. My z-Axis allows 3 positions: front, middle, back. What I need is no transparency at front, 33% transparency for middle layer, 50% transparency for the back position. Best regards Alex
  10. Hi, is it possible to change the Transparancy of a texture after it has been bind to a object? For example: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_MyFileTexture.TextureID); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glCallList(fileDL); glDisable(GL_TEXTURE_2D);
  11. hury

    Get coordinates

    Solved it that way: GLdouble modelMatrix[16]; GLdouble projMatrix[16]; GLint viewport[4]; glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); glGetIntegerv(GL_VIEWPORT, viewport); GLdouble xi ,yi ,zi ; GLdouble ix ,iy ,iz ; gluProject(xPointer, yPointer, zPointer, modelMatrix, projMatrix, viewport, &xi, &yi, &zi); gluProject(ico.getIconVector().at(x)->getX(), ico.getIconVector().at(x)->getY(), ico.getIconVector().at(x)->getZ(), modelMatrix, projMatrix, viewport, &ix, &iy, &iz); cout << "Pointer Xi: " << xi << "\n"; cout << "Icon Xi: " << ix << "\n";
  12. Hi, i draw 3 triangles, which are my mousepointer: Quote: void Cursor::draw() { glLoadIdentity(); glTranslatef(x , y, z); glRotatef(-120, 0, 1, 0); glRotatef(-25, 1, 0, 0); glRotatef(cursorRotator, 0, 0, 1); glScalef(0.1f, 0.1f, 0.1f); glEnable(GL_BLEND); glEnable (GL_SMOOTH); glBegin(GL_TRIANGLES); // Fange an Dreiecke zu zeichnen glColor3f(0, 0.5f, 0); glVertex3f(0, 0 , 0); glColor3f(0, 0.5f, 0.5f); glVertex3f(0, 1 , -2); glColor3f(0, 0.5f, 1); glVertex3f(1, 0 , -2); glColor3f(0.5f, 0, 0); glVertex3f(0, 0 , 0); glColor3f(0.5f, 0.5f, 0); glVertex3f(0, -1, -2); glColor3f(0.5f, 1, 0); glVertex3f(1, 0 ,-2); glColor3f(0, 0, 0.5f); glVertex3f(0, 0, 0); glColor3f(0, 0.5f, 0.5f); glVertex3f(-1, 0, -2); glColor3f(0, 1, 0.5f); glVertex3f(0, -1, -2); glColor3f(0.5f, 0, 0); glVertex3f(0, 0 , 0); glColor3f(0.5f, 0.5f, 0); glVertex3f(-1, 0 , -2); glColor3f(0.5f, 1, 0); glVertex3f(0, 1 , -2); glEnd(); } How is it possible to get the (real) x, y, z Coordinates, after my triangles has been rotated with glRotatef(-120, 0, 1, 0); and glRotatef(-25, 1, 0, 0); ? Best regards Alex
  13. Hi, i draw an triangle and want it to rotate on its own x-Axis. Quote: glLoadIdentity(); glRotatef(cursorRotator, 1.0f, 0.0f, 0.0f); glTranslatef(0 , 0, -5); glBegin(GL_TRIANGLES); // Fange an Dreiecke zu zeichnen glColor3f(0.2f,0.2f, 0.2f); glVertex3f( 0, 0.15f, 0); // Punkt1 (oben rechts) glColor3f(0.2f,0.5f, 0.2f); glVertex3f(-0.25f, 0.25f, 0); // Punkt2 (oben links) glColor3f(0.2f,0.2f, 0.7f); glVertex3f(-0.1f, 0.05f, 0); // Punkt3 (unten links) glEnd(); if (rotateCursor) cursorRotator += 0.3f; My problem is, that the triangle rotates not on its own, but on the World coordinates x-Axis, which is 5 units in front of the triangle, so it flys out of the screen. How can I fix that? Thanks Alex
  14. hury


    Yes, that would be great.
  15. hury


    Do you have an screenshot of that?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!