| |
|
|
| KompilierenMarcaSeparación
ogl.mySphere(float x,y, z,float r,int n){
floats et, eb, pt, pb
int i,j
float theta1,theta2,theta3
float twopi = pi() * 2,pid2 = pi() / 2
case (r <= 0) : r = 0.1
case (n < 4) : n = 4
int nn = n2
for j=0 to nn do begin
theta1 = j * twopi / n - pid2
theta2 = (j + 1) * twopi / n - pid2
glBegin(GL_QUAD_STRIP)
for i=0 to n do begin
theta3 = i * twopi / n
et[0] = cos(theta2) * cos(theta3)
et[1] = sin(theta2)
et[2] = cos(theta2) * sin(theta3)
pt[0] = x + r * et[0]
pt[1] = y + r * et[1]
pt[2] = z + r * et[2]
glNormal3f(single(et[0]),single(et[1]),single(et[2]))
glTexCoord2f(single(i/n),single(2*(j+1)/n));
glVertex3f(single(pt[0]),single(pt[1]),single(pt[2]))
eb[0] = cos(theta1) * cos(theta3)
eb[1] = sin(theta1)
eb[2] = cos(theta1) * sin(theta3)
pb[0] = x + r * eb[0]
pb[1] = y + r * eb[1]
pb[2] = z + r * eb[2]
glNormal3f(single(eb[0]), single(eb[1]), single(eb[2]))
glTexCoord2f(single(i/n),single(2*j/n));
glVertex3f(single(pb[0]), single(pb[1]), single(pb[2]))
oGL("glTexCoord3f",single(eb[0]), single(eb[1]), single(eb[2]))
end
glEnd()
| | | | |
| | | Oben otra vez aktualisiert, en el Übersetzung después de C fueron el Texturkoordinaten vergessen... |
| | | | |
|
Zum QuelltextThemeninformationenDieses Thema ha 1 subscriber: |