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...
Type: Posts; User: dolf
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...
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...
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...
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...
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...
Could you try adding a glLoadIdentity() after glMatrixMode(GL_MODELVIEW)?
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...
What you describe here sounds a lot like you apply pitch and roll in the wrong order.
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...
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.
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...
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...
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.
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...
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...
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...
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...
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...
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...
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...
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...
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...
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;...
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]);
...