PDA

View Full Version : 2 Questions - Torus & Text



unleashed
04-23-2001, 03:42 PM
I am looking to do both using the "gl...." not "glut.....".

Is this possible, all i have found is glut calls (and example programs) to do both the torus and text. If it would not be asking too much, would someone be willing to give me examples using "gl...." if possible, or direct me to a site that has this...I dont need anything special, just a very basic example so i can toss it in my program and play with it.
thanks

Warrior
04-23-2001, 03:53 PM
Hi unleashed -
to draw a torus using gl functions, you will need an algorithm. I dont know one, but im sure someone in this forum does. Or try to comp.graphics.algorithms newsgroup. That newsgroup also has a FAQ which might contain your answer.
As for text, thats easy. there is many different ways to do it, which are demonstrated using gl functions at NeHe OpenGL (http://nehe.gamedev.net)
-Dave

Lord crc
04-24-2001, 10:26 AM
if you dont die reading some pascal code, heres what i use

count:= 0;
for hAngle:= 0 to FSegments-1 do
begin
hRad:= hAngle * (2 * pi / FSegments);

for vAngle:= 0 to FSides-1 do
begin
vRad:= vAngle * (2 * pi / FSides);

v.x:= cos(hRad) * (Radius1 + cos(vRad) * Radius2);
v.y:= sin(hRad) * (Radius1 + cos(vRad) * Radius2);
v.z:= sin(vRad) * Radius2;

Verts[count]:= v;

inc(count);
end;
end;

count:= 0;
for hAngle:= 0 to FSegments-1 do
begin
for vAngle:= 0 to FSides-1 do
begin
f[2]:= hAngle * FSides + vAngle;
f[1]:= hAngle * FSides + (vAngle + 1) mod FSides;
f[0]:= (hAngle * FSides + (vAngle + FSides)) mod nVerts;
Faces[count]:= f;
inc(count);

f[2]:= hAngle * FSides + (vAngle + 1) mod FSides;
f[1]:= ((hAngle * FSides + (vAngle + 1) mod FSides) + FSides) mod nVerts;
f[0]:= (hAngle * FSides + (vAngle + FSides)) mod nVerts;

Faces[count]:= f;
inc(count);
end;
end;

unleashed
04-24-2001, 10:30 AM
I wont die at all, i have been coding in Modula-2 for parallel programming for quite some time. Thanks for the help!!

Lord crc
04-24-2001, 02:02 PM
sorry about the layout, didnt know they stripped it clean of spaces http://www.opengl.org/discussion_boards/ubb/smile.gif