Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Search:

Type: Posts; User: sueyllam

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Well this was wrong but that was not the reason...

    Well this was wrong but that was not the reason for the program crashing. I finally figured it out thanks to replies by GClements and Reinheart, I kept looking for problems with buffers and I was...
  2. Never mind I found the problem, it was this line:...

    Never mind I found the problem, it was this line:
    vPositionPad = glGetAttribLocation( program, "vPositionPad" );
    in the OnInit() function, it should be program1 and not program. The vertex shader...
  3. OK, but that does not explain why it succeeded...

    OK, but that does not explain why it succeeded the first time and crashed on the second call. If it were a problem with pointers or buffer offset or insufficient data, shouldn't it crash the first...
  4. Thanks for the enlightening reply, but I still do...

    Thanks for the enlightening reply, but I still do not understand why the glutSwapBuffers(), i.e., the onRender() function was called a second time immediately after the first time it was called from...
  5. Problem with glutSwapBuffers when using multiple shader programs

    I have the following Pong game program which is working fine using one set of shader programs for displaying the red ball and the green pads passing the color as a uniform to set the color in the...
  6. Replies
    3
    Views
    415

    Well, the only thing related to opengl, is that...

    Well, the only thing related to opengl, is that you need to convert the mouse y to height-y since the origin of the screen coordinate is at the top left and the origin of opengl world coordinate is...
  7. Replies
    3
    Views
    415

    Well you need to convert the mouse screen...

    Well you need to convert the mouse screen coordinates (x and y) into your world coordinates, i.e. in terms of (clipAreaXleft,...), then compare these transformed coordinates with the area covered by...
  8. Replies
    3
    Views
    694

    try a simple image of 3 spheres or even triangles...

    try a simple image of 3 spheres or even triangles one is red and one is green and one is blue and see how the colors get mapped when you save the scene... I had to use BGR instead of RGB in...
  9. Thread: Blending

    by sueyllam
    Replies
    7
    Views
    937

    Never mind I found the problem, I should have...

    Never mind I found the problem, I should have disabled blending before drawing in black instead of after it...





    // Draws the current image.
    void draw() {
    glClear(GL_COLOR_BUFFER_BIT |...
  10. Thread: Blending

    by sueyllam
    Replies
    7
    Views
    937

    Correction, I noticed that the second sphere does...

    Correction, I noticed that the second sphere does get drawn in areas outside the first red sphere. When I set background to black everything works fine. I am puzzled!?
  11. Thread: Blending

    by sueyllam
    Replies
    7
    Views
    937

    Anyway I went with the second option but without...

    Anyway I went with the second option but without a stencil buffer. I drew the spheres after setting color to black, then drew again into frame buffer with blending GL_ONE GL_ONE.
    I got the first...
  12. Thread: Blending

    by sueyllam
    Replies
    7
    Views
    937

    I do not think glColorMask () can be used easily...

    I do not think glColorMask () can be used easily as you mentioned since when rendering the second green ball I want to hold off the red component over the first red ball but want to write the red...
  13. Thread: Blending

    by sueyllam
    Replies
    7
    Views
    937

    Thanks for the informative reply, yes indeed it...

    Thanks for the informative reply, yes indeed it works but I should add that the background color has to be black for it to work fine. A white background messes up things....
  14. Thread: Blending

    by sueyllam
    Replies
    7
    Views
    937

    Blending

    I have the following code that displays a red and a green sphere in orthographic view with the green sphere shifted a bit in X. I used the depth function always to get an idea of the shift in case...
  15. May be because x and y of mouse map to axis x and...

    May be because x and y of mouse map to axis x and axis z vec[0] and vec[2], then you compute axis y: vec[1] = 1- (vec[0]^2+vec[2]^2)...Currently you map x and y of mouse to axis x and y instead....
  16. Replies
    1
    Views
    415

    defining a timer function can help you. See...

    defining a timer function can help you. See glutTimerFunc() in glut specs...
  17. Well I was referring to the vertex shader that I...

    Well I was referring to the vertex shader that I intended to write in opengl4. But thanks I think I will use Compatibility profile. I looked at another option which comes with glsdk in glutil but it...
  18. Displaying freeglut strokefont text in opengl4

    I have the following code:



    #include <iostream>
    #include <GL/glew.h>
    #include <GL\freeglut.h>
    //#include <glm/glm.hpp>
    //#include <glm/gtc/matrix_transform.hpp>
    #include <stddef.h>
  19. Replies
    2
    Views
    697

    First you used deprecated openGL pre programmable...

    First you used deprecated openGL pre programmable shaders. I suggest writing it using opengl3.3 or greater and use shaders. That would be challenging.
    Now why nothing gets drawn, the mouse...
  20. Replies
    3
    Views
    478

    Also you need glBegin(GL_POINTS) glEnd() to...

    Also you need glBegin(GL_POINTS) glEnd() to bracket the glVertex call to let it known that you want to render individual pixels.
  21. Replies
    2
    Views
    370

    I believe adding the following to the beginning...

    I believe adding the following to the beginning of your render_prepare function would make it work:

    glGenVertexArrays(1, &vao);
    glBindVertexArray(vao);

    where vao is GLuint
  22. Replies
    3
    Views
    416

    I finally found the bug, it was stupid, in the...

    I finally found the bug, it was stupid, in the OnInit function the following chunk of cod

    size_t colorDataOffset = sizeof(float) * 3 * numberOfVertices;
    glBindBuffer(GL_ARRAY_BUFFER,...
  23. Replies
    3
    Views
    416

    Well to make things worse, I rewrote the code...

    Well to make things worse, I rewrote the code using good old deprecated GL2 and I got the robot displayed. Everything is the same except changing drawElements to Begin End with a loop inside to...
  24. Replies
    3
    Views
    416

    Well, printing the 2 vertices (-1,-1,-1,1) and...

    Well, printing the 2 vertices (-1,-1,-1,1) and (+1,+1,+1,1) by the matrices in the code and printing out the results after dividing by W, it does not seem that clipping
    happens at all, everything is...
  25. Well I noticed that in your new vertices the...

    Well I noticed that in your new vertices the vertex -1.0, -1.0, 0.0 is missing, instead you wrote one of the vertices twice....
Results 1 to 25 of 47
Page 1 of 2 1 2