Note that there are some explanatory texts on larger screens.

plurals
  1. PODefining and Manipulating a 3D Object with Specific Rotations
    primarykey
    data
    text
    <p>I have rendered a very rough model of a molecule that consists of 7 helices and would like to ask if there is anyway possible to allow the helices themselves to tilt (rotate) in certain ways so as to interact with one another. For clarity, I insert an image of my program output (although for an orthographic projection, so it appears as the projection of a 3D helix onto a 2D plane). </p> <p><img src="https://i.stack.imgur.com/bfaXs.jpg" alt="enter image description here"></p> <p>I have included the code for rending a single helix (all others are the same). </p> <p>Would it be useful to store the geometry of my objects in vertex arrays instead of rendering them each time separately for the 7 different colors? (Each helix consists of 36,000 vertices and I am concerned that the arrays might get large enough to cause serious performance issues?)</p> <p>I understand the matrix stack is the data structure for performing multiple consecutive individual transformations on particular objects, but I not sure how exactly to specify so that an entire one of my helices can tilt? (glRotatef does not actually tilt the helices for some reason) </p> <pre><code>/*HELIX RENDERING*/ glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(0.0, 100.0, -5.0); //Move Position glRotatef(90.0, 0.0, 0.0, 0.0); glBegin(GL_LINE_STRIP); for(theta = 0.0; theta &lt;= 360.0; theta += 0.01) { x = r*(cosf(theta)); y = r*(sinf(theta)); z = c*theta; glVertex3f(x,y,z); glColor3f(1.0, 1.0, 0.0); } glEnd(); glPopMatrix(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload