• Advertisement

Daniel Lee

  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Daniel Lee

  • Rank
  1. allo one and all, in my Linux openGL application, the scene is moved with the camera parameters in glLookAt(...) changes, but i need to fix the positions of hte text info on the screen while the scence is moving. Please advise how that can be achieved. thanks.
  2. wrt my earlier post, your lot of code has no chance to try, as even with a single line of code like glClearColor(0, 0, 0, 0), that crashed the SDL window. thanks.
  3. my current design has the screen divided into 4 viewports. Hence there is 4 threads. Each thread will take care of one viewport. But (if you refer back to my posting) i only use 1 thread to test that idea and even one single use of glClear(,,), crashed the SDL window. I mentioned SDL window as the main module of the project is created using :- if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO) != 0){ pScreen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, FLAGS); } /// creates threads etc.... /// game loop i hope that updates your request for my experiment. please advise further. thanks.
  4. hi one and all, please advise as to why and how to do it properly or is it possible at all by setting up openGL and drawing routines in some threads in the linux environment. my scenario is like this:- in my main cpp--- module:-------------------------------------> SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); pScreen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, FLAGS); pThread1 = SDL_CreateThread(threadEntryPoint, NULL); /*== the Game Loop ==*/ do{ keyBoard(); while(iRes != -1); ///----------------------------------------------------------. in the thread module, it called the following:- int tVp1setup(void){ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glViewport( 0, pScreen->h*3/16, pScreen->w*5/18, pScreen->h*13/16); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective( 25.0f, /// 20.0f, GLfloat(pScreen->w*5/18) / GLfloat(pScreen->h*13/16), 1.0f, 5000.0f); gluLookAt(0.0, 0.0, 120.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ); ///--> SDL_GL_SwapBuffers(); }///end of tVp1Setup(). But only when the above is called, it crashed the SDL window. please advise or provide sample of multithreading openGL in SDL in Linux. Thank you. mrdaniel@singnet.com.sg
  5. soccerball.3ds

    how do i attach jpgs for your view of my problem. meanwhile if you guys can email to me directly I can send you attachments so that you can help me overcome the problem. my email is:- mrdaniel@singnet.com.sg thanks.
  6. soccerball.3ds

    i'd used a 3dsLoader from the lesson in this forum to load the free-of-charge soccerball.3ds downloaded from turbosquid but the final look is far from the original. What is needed to achieve a full representation of the original ?
  7. character sets

    my concept of drawing the alphabets is to have it color better looking than just one flat color just why the use of 3 color specification in the rendering section. so for that if I use only one color specification and then callList it will draw the alphabet with one solid color which is not what the original intention was. So is there some way to that just that. ciao.
  8. character sets

    well i think i understand your tip, but note that in the rendering stage 3 colors are already specified like :- glBegin(GL_TRIANGLES); glColor3f(1.0, 1.0, 1.0); glVertex3f( obj.vertex[ obj.polygon[l_index].a ].X, obj.vertex[ obj.polygon[l_index].a ].Y, obj.vertex[ obj.polygon[l_index].a ].Z); glColor3f(0.0, 1.0, 0.0); glVertex3f( obj.vertex[ obj.polygon[l_index].b ].X, obj.vertex[ obj.polygon[l_index].b ].Y, obj.vertex[ obj.polygon[l_index].b ].Z); ///----------------- THIRD VERTEX ----------------- glColor3f(0.0, 1.0, 0.0); glVertex3f( obj.vertex[ obj.polygon[l_index].c ].X, obj.vertex[ obj.polygon[l_index].c ].Y, obj.vertex[ obj.polygon[l_index].c ].Z); glEnd(); hence i need to find an alternative method to draw those colored-objects ciao
  9. character sets

    my code works in 2 phase:- [1] prepare [2] draw nb:- gluiBase1 = glListBase(128); in the stage [1], the char is render with color as follows:- prepareChar(GLuint gluiBase, char c, int iClr){ load3ds(c); glBegin(); glNewList(gluiBase + c); render_vertex3f_with_color_i(iClr); glEndList(); glEnd(); } [2] it is then drawn as follows:- drawChar(GLuint gluiBase, char c){ glBegin(); glCallList(gluiBase + c); glEnd(); } the above summarised in simplified form and thus can be seen if the same char is used but with different iClr, definitely the previous one will be overwritten.Thus maybe another char set will help like the following:- gluiBase1 = glListBase(128); and gluiBase2 = glListBase(128); and then pass one of those to the above routines, but those did not seemed to worked. please advise. daniel lee.
  10. character sets

    sorry of my comments there was a typo error :- it should read please think simple. ciao
  11. character sets

    what i was with characater set is basically a 3d object and it resembles alphabetical characters and not texture objects. Take it as one of the 26 characters. The color for any one of them presented no issue But only for applying different color to a same character like what were described earlier. For example A, A, & A. if all the "A"s is the same color no problem but only if I want them to be different. Though I'd repeated my explaination here please bear wih me and you must not think simple of what is to be done. ciao
  12. character sets

    I need to display more than 1 set of text characters in various colors. But currently do not know of a way to do so. Currently I'd only one character set that is 128 ASCII. When any of similar characters are rendered to a new color, the previous one is affected therefore i thought maybe by creating more than one set is the correct approach. please advise on how to achieve that or provide alternative solutions. as illustration:- "aaa" first "a" red, second "a" yellow, third "a" green. I used the following line to display the characters. glCallList(gluiBase + char) but not able to get those "aaa" in 3colors. thanks daniel
  13. can anyone advise on how do determine the sizes of various 3D Objects as it is needed to be placed side by side with other objects without being overlapped. you can take for example sveral balls which needed to be placed horizontally besides one another. thanks
  14. howto speed up rendering with 5 viewports

    so far all my code is built on the display list principle, and i would greatly like to try the use VBO. however there is some limitatiions if I have not misunderstood. By the way, is Vertex Arrays anything to do with Vertex Buffer Objects.?
  15. howto speed up rendering with 5 viewports

    what's VBO please and can you send over a sample code on how to init and use it. ciao
  • Advertisement