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: dolf

Search: Search took 0.01 seconds.

  1. Thread: Simple question

    by dolf
    Replies
    3
    Views
    1,793

    Re: Simple question

    Simple. You use unscaled values for the texture coordinates (x1,....,y2) and scaled ones for the geometry coordinates (radius*x1,...,radius*y2).

    But one thing is completely beyond my understanding...
  2. Replies
    2
    Views
    208

    Re: How to find the target position?

    I guess the D matrix is mysterious in the previous post, the original poster talked about angles in degrees. Let's say we are in the XY plane and have a heading rotation in the plane H and a pitch...
  3. Thread: CPU instead GPU

    by dolf
    Replies
    10
    Views
    896

    Re: CPU instead GPU

    Just an uneducated guess: what if you take either one or both of

    cgGLBindProgram(prog);
    cgGLEnableProfile(fprog_profile);

    out of Pass and place them in the program initialization code? It...
  4. Thread: Scaling 3D points

    by dolf
    Replies
    4
    Views
    235

    Re: Scaling 3D points

    It appears to me that you want to fit the points' bounding box into that "grid", a rectangle with one corner at the origin and width/height/depth along X/Y/Z axes, respectively.

    - determine the...
  5. Replies
    3
    Views
    866

    Re: Stereographic Projection?

    Sure stereoproj is linear: You have points on a sphere seen by a perspective viewer at the antipodal point. The only nonlinear part is the conversion from latitude and longitude (and altitude) into...
  6. Replies
    5
    Views
    335

    Re: Rotation problems (object distortion)

    Could you try adding a glLoadIdentity() after glMatrixMode(GL_MODELVIEW)?
  7. Replies
    5
    Views
    335

    Re: Rotation problems (object distortion)

    The following obvious bugs:
    - in draw(), glPopMatrix is missing. This may lead to strange accumulations of matrices.
    - in glFrustum, you have near==far. It is surprising to me that you see anything...
  8. Replies
    10
    Views
    2,146

    Re: Gimbal Lock Problem

    What you describe here sounds a lot like you apply pitch and roll in the wrong order.
  9. Replies
    4
    Views
    1,690

    Re: transform 4x4 matrix into scale/rotation/move ?

    After ripping out the translation of column 3, you could use singular value decomposition on the remaining 3x3 matrix.

    This is the tool to deal with all the ugly cases that the literature usually...
  10. Replies
    9
    Views
    1,808

    Re: Function to 'pinch' a mesh

    Or try the height--dependent radius r(z)=1.1 + cos(z - 0.5*sin(z)) with z going from0 to 2*PI. That's how I imagine an hourglass.
  11. Replies
    3
    Views
    289

    Re: Direction Vector from Plane

    Assume that you have 3 points p, q, r in the plane. One way to compute the plane normal is then e.g. n=cross(q-p,r-p).

    You can use n as the rotation axis in glRotate, but also either of the...
  12. Re: Volume Rendering - projecting object-alined slices to viewpoint-aligned slices

    You could, in addition to what hifuGL suggested, render all 3 object-aligned stacks from back to front, with opacity proportional to the dot product between surface normal and viewing vector.

    The...
  13. Replies
    12
    Views
    5,972

    Re: Adjustable rounded cube mesh generator

    And it works with an Icosphere, too. This way, one gets nearly equal distribution of vertices on the rounded corners. I imagine that it will be tricky to generate this mesh with a program.
  14. Replies
    12
    Views
    5,972

    Re: Adjustable rounded cube mesh generator

    I did it interactively with Blender, making an UV sphere, extruding half the vertices along each of the 3 axes, and voilĂ*. I didn't get an equal distribution of the vertex density on the rounded...
  15. Replies
    8
    Views
    524

    Re: L-systems, anyone?

    Just a very rough idea: The ugly things with a cylinder-based rendering strategy are the branches. Now what about a metaball-like approach, like so: determine all the sticks going out from the branch...
  16. Re: Drawing Arcs Connecting Two Points on a Sphere

    Assume that you have two radius vectors v and w. Take the cross product r = cross(v,w) and its absolute value lr = |r| and determine the angle between v and w as a = arcsin(lr/(|v|*|w|)).

    The...
  17. Re: Drawing a gradient fill in 2D vector based objects

    Linear gradients are trivial. Generate a 1D texture, and assign 1d texcoords to all your mesh vertices increasing linearly along the progression direction of the gradient.

    All other gradient types...
  18. Replies
    1
    Views
    238

    Re: should I use slope or another metho

    Slope doesn't work for 'vertical' lines. Better is the difference vector between adjacent road segment midpoints and its normalized perpendicular. What you need additionally are the angle bisectors...
  19. Thread: plot circle

    by dolf
    Replies
    2
    Views
    277

    Re: plot circle

    Normally, you'd be doing this with glRenderMode(GL_SELECT) etc.

    Alternatively, you could compute the on-screen location of the circle center (cx,cy) and one point (rx,ry) on the circumference...
  20. Replies
    4
    Views
    237

    Re: matrix manipulation optimization

    As usual, it depends - when you emit many glVertex'es without changing the transformation, it doesn't matter. Vertices will always be transformed by the current modelview matrix. But when you change...
  21. Replies
    3
    Views
    865

    Re: finding contour lines that are closest

    This problem is not uniquely solvable, since a contour may either represent an increment or a decrement of altitude. Consequently, when you regard the contour lines of a mountain, they may as well be...
  22. Replies
    4
    Views
    322

    Re: Roll Stabilized Camera w/Quaternion

    We want to formulate a rotation about the front direction that turns our roll into given_roll.

    In order to do this, we perform a Gram-Schmidt normalization step of the up axis with respect to the...
  23. Thread: strafe? ? ?

    by dolf
    Replies
    5
    Views
    1,269

    Re: strafe? ? ?

    Theoretically, one could use the modelview matrix generated by gluLookat (or any matrix for that matter) to strafe left by an amount of l.

    double m[16];
    double l;...
  24. Replies
    3
    Views
    364

    Re: rotate onto a given vector

    Assume your line to be given by the points P and Q, and your airplane reference direction to be heading=pitch=0. Assume further that Z is up.

    Then

    heading=atan2(Q[1]-P[1],Q[0]-P[0]);
    ...
Results 1 to 24 of 24