• Content count

  • Joined

  • Last visited

Community Reputation

135 Neutral

About Sword7

  • Rank
  1. Folks,   Does anyone know any HUD algorithms like pitch ladder, compass tape, direction, velocity vector, etc for writing flight simulators? I was looking for them through google and books but did not found information so much. That's why I am looking for OpenGL-based HUD drawing routines for glass HUD display and MFD window.   Thanks, Tim Stark  
  2. Folks, I am figuring formula for split decision by using varying FOV. I read some books about terrain 3D engine and some papers but they did not mention any formula for split decision. One of books mentioned simple formula by using metric errors and system errors but did not mention more information about error determination. Does anyone know any source about clearly explanation about formula for split decision by using metric errors and varying FOV? I am trying to develop procedural planet routines for orbiter simulation. Thanks!
  3. Help! iterator problem

    Ok, I figured them out.  I decided to remove 'const' from function call and all problems were gone.   Non const iterator did not work in const function calls because compiler complaint about 'no match for operator =' error messages at for(...) statement.   I am using MinGW with GNU C++ 4.8.2 compiler.
  4. Folks,   I am working on my orbital flight simulator in C++ language.  I tried to implement find function call in class StarDatabase but encountered two blocking error messages. With using 'iterator', compiler complained about 'no match for operator ='.  I changed to 'const_iterator' and it worked but complaint 'invalid conversion from const to non const' at return statement.  That's why I want to return non const Star class to the caller to update it.  Does anyone know any solution or working around.   Look at my code below.   Thanks, Sword7 std::vector<Star> unsortedStars; Star *StarDatabase::find(uint32 catalogNumber) const { std::vector<Star>::iterator iter; for (iter = unsortedStars.begin(); iter != unsortedStars.end(); iter++) { if ((*iter).getCatalogNumber() == catalogNumber) return &(*iter); } return NULL; }
  5. Folks,   I am getting fimilar with my OpenGL programming since last Spring and successfully wrote a program to display planet Earth by using ECP spherical mapping (slices and rings division).  Only problem is too tight grids near poles.   Now I researched about quadcube spherical programming for cubmap images through Internet.  I found some pages but it do not have sample code about that quadecube grids. Without sample code, I did still not know how to implement code to display quadcube sphere through simple vertexes, indices, and texcoords for glDrawElements function call.   Does anyone have any sample/example codes for quadcube sphere mapping for cubemaps?   Thanks!  
  6. Hello folks,   Good news!!! I now found a problem and corrected formula. It finally works!!!   Quaternion w(0, angularVelocity);   dr = 0.5 * (orientation * w); orientation += (dr * dt); orentation.normalize();   It now rotates in local axes!!   If w * orientation, it rotates in world axes. if orientation * w, it rotates in local axes.   I googled and found article that explains about world axes and local axes in quaternions.   http://stackoverflow.com/questions/9715776/using-quaternions-for-opengl-rotations http://www.arcsynthesis.org/gltut/Positioning/Tut08%20Quaternions.html
  7. Ok, I changed that lines to:   dr = orientation * (angularVelocity * 0.5) * orientation.conjugate(); orientation += (dr * dt);   I resolved a problem but I got another new problem.  For example, When I roll right to 90 degress, tried to yaw right but rotate 45 degrees between pitch and yaw axis.  Also, I continued to play controls, controls became locked out.  I can't yaw, pitch, or roll anymore after a few minutes when w in orentation became zero [ 0 (x, y, z)].    I tried that 'dr = orientation * angularVelocity * orientation.conjugate()' but it resulted the same.   Quaternion<double> conjugate() {    return Quaternion<double>(w, -x, -y, -z); }   Right?   Thanks! Sword7
  8. Hello folks,   I am writing a small program to display planet earth by using glDrawElements and vertex/indices array.   It normally displays planet earth but seam strip between alaska and russia land.  I think that it is a problem with texcoords or glDrawElements function call.  I tried different ways but it always display distrotion strip.  Does anyone know any working around to get rid of distrotion strip? Look at my code below.   Thanks! Sword7       int    thetaExtent = extent;     int    phiExtent   = extent/2;     int    theta1      = theta0 + thetaExtent;     int    phi1        = phi0 + phiExtent;     double phiStep     = (PI) / phiExtent;     double thetaStep   = (2 * PI) / thetaExtent;       double *v = vertices;     double *t = texCoords;     for (int phi = phi0; phi <= phi1; phi += ri.step) {         for (int theta = theta0; theta < theta1; theta += ri.step) {             *v++ = sin(phi * phiStep) * cos(theta * thetaStep);             *v++ = cos(phi * phiStep);             *v++ = sin(phi * phiStep) * sin(theta * thetaStep);             *t++ = 1 - (theta * (1.0 / thetaExtent));             *t++ = phi * (1.0 / phiExtent);         }     }     uint16 *i = indices;     for (int p = 0; p < phiExtent; p++) {         for (int t = 0; t < thetaExtent; t++) {             *i++ = p * thetaExtent + t;             *i++ = p * thetaExtent + (t+1);             *i++ = (p+1) * thetaExtent + (t+1);             *i++ = (p+1) * thetaExtent + t;         }     }       glVertexPointer(3, GL_DOUBLE, 0, vertices);     glNormalPointer(GL_DOUBLE, 0, vertices);     glTexCoordPointer(2, GL_DOUBLE, 0, texCoords);     glDrawElements(GL_QUADS, nIndices, GL_UNSIGNED_SHORT, indices);
  9. Hello folks,   I am new to this gamedev.net forum that I searched for and found.  I searched for angular velocity and quaternion on Google but they did not help so much.  I implemented quaternion and angular velocity control (by using keyboard).  When I pitch to 90 degrees down, I tried to yaw right but it rolls right instead.  At zero Z-axis angle, it normally yaw right or left.  I want to rotate at current local axes, not origin axes.   My code implementation is:   dr = (angularVelocity * 0.5) * orientation; orientation += (dr * dt); orientation.normalize();   Where dt = delta time, dr = delta rotation   Does anyone have different angular velocity/quaternion formula to yaw, pitch, and roll at current local axes?   Thanks, Sword7