English
Source / code snippets

bullet Opengl Sphere Uvsphere

 

CompileMarkSeparation
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()
    
1.039 kB
Hochgeladen:09/01/08
Downloadcounter231
Download
 
09/01/08  
 



supra again updated, in the Translation to C get The Texturkoordinaten forget...
 
09/01/08  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.619 Views

Untitledvor 0 min.
Tango10/30/21
Sven Bader08/12/21
H.Brill08/08/21
Frank04/16/21
More...

Themeninformationen

this Topic has 1 subscriber:

iF (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie