CsGL : Drawing a grid...

Started by
1 comment, last by Galo 19 years, 7 months ago
Hey there, I'm just starting out though so i could be wrong,... But i wanted to know, if you would like to draw a space-grid (x,y,z) is it true you first have to draw points and then connect them ? I was thinking of programming a loop which has a pointer that start at coordinates 0,0 (x,y) and then moves that every 10 units or so, then connect the points and i should have a grid no ? Please correct me if im wrong i searched on google and this forum but since im working with c# and csgl and everything is still based on OpenGL it's hard to find information! Cheers, Galo
bla bla bla
Advertisement
you should probably re read the chapter on drawing primitives and matrix stacks.

try this. it's not csGL specific, but it's open standard, so it should be pretty much the same:D

glColor3f(1,1,1);glBegin(GL_LINES);for(int j = 0 int pass = 1; j < NUM_OF_LINES; j++){glVertex3f(NEAR_CLIP,j,0);glVertex3f(FAR_CLIP,J,0);if(j = NUM_OF_LINES);{if(pass=1){j=0glRotatef(90,1,0,0);}if(pass=2){glRotatef(-90,1,0,0)//you realy don't need to do this but it's to //avoid overruns.break;}}glEnd();


edit: that was helpfull and took up my valueable time, rate me up :D
| Member of UBAAG (Unban aftermath Association of Gamedev)
Rating done :D thanks for that.

The thing i was thinking of since these lines are drawn, is it posible to make a grid out of vectors so they render faster and better in the viewport ?

I'm gonna re-write that part you gave me in c# for CsGL, could take a while since the documentation is the worst i've ever seen.

wish me luck,

Galo
bla bla bla

This topic is closed to new replies.

Advertisement