drawing a line in 3-d?

Started by
5 comments, last by kc_0045 20 years ago
Hey im doing some of the opengl tutorols but im just wondring how can i draw a line in 3d? like drawline(0.0f,0.0f,0.0f); or somthing like that. ty in advanced.
Advertisement
glBegin(GL_LINES);

glVertex3f(fromX, fromY, fromZ);
glVertex3f(toX, toY, toZ);

glEnd();

also start reading the red book. it''s got all this stuff in it.

http://fly.cc.fer.hr/~unreal/theredbook/

-me
Might anyone know a simple way to draw lines that are not pixel-sized (but units)?
glBegin(GL_QUADS);

---------------------------------
For an overdose of l33tness, flashbang.nu
''lo

perhaps glLineWidth ?
im serious, glLinewitdh is still in pixels, quads is the only way to get lines that has width in units.

---------------------------------
For an overdose of l33tness, flashbang.nu
You can specify a float for the width. You can also anti-alias it so it will look nice. Use a quad when you need to have a texture running down the line.

This topic is closed to new replies.

Advertisement