View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

# Fastest way to draw dots in 3D

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

### #1Jesper T  Members

Posted 02 August 2001 - 11:20 AM

Im makin a program (screenshot: http://home.online.no/~7396/delta/images/double.jpg ) ..and well.. as you can c from the screenshot, I need to draw lots of dots in it. Currently the dots are small triangle pyramids. That is a problem because they take to much time to render. So my question is: does anyone know a way to render a ''dot'' in 3D space fast ? ..and it doesn''t matter how it looks; it only needs to be visable, and not to big. Thanks for any help

### #2core114  Members

Posted 02 August 2001 - 02:20 PM

you could try having a single triangle facing the camera, maybe with a texture to make it a dot.

### #3zedzeek  Members

Posted 02 August 2001 - 07:02 PM

glVertexPointer(....)
glDrawArrays( GL_POINTS, 0, num_of_dots );

### #4Jesper T  Members

Posted 02 August 2001 - 11:18 PM

Thanks for the help, but how excactly does it work ?
does the glVertexPointer point to a set of coordinates ?
will this draw a point :

glDrawArrays(GL_POINTS, 0, 1 );
glVertex3f(0.0f, 0.0f, 0.0f);

?

PS, I''ve thought about using a single triangle facing the camera, but it still requires a lot of calculations compared to what a dot would require.

### #5Uros Bergant  Members

Posted 02 August 2001 - 11:40 PM

In DX you only need:

D3DDevice.DrawIndexedPrimitive(D3DPT_POINTLIST, D3DFVF_VERTEX, m_pVertices[0], m_dwNumVertices, pIndices^, dwNumIndices, 0 );

where

m_pVertices: array of vertices
m_dwNumVertices: number of vertices
pIndices^: vertex indices
dwNumIndices: number of indices

### #6panda_master  Members

Posted 03 August 2001 - 02:11 AM

You''re not in the right forum Uros...

### #7Julio  Members

Posted 03 August 2001 - 04:09 AM

glBegin(GL_POINT);
glVertex3f(x,y,z);
glEnd();

edit- that's not the fastest way, but that's how you do it. for speed try display lists for static stuff or vertex arrays for dynamic stuff.

How many Microsoft employees does it take to screw in a light bulb?
None, they just declare drakness as a new standard.

Edited by - Julio on August 3, 2001 11:09:50 AM

### #8zedzeek  Members

Posted 03 August 2001 - 11:31 AM

GLfloat verts[] = { {0,0,0}, {0,1,0}, {1,1,0}, {23,3,3} };

glEnableClientState( GL_VERTEX_ARRAY );
glVertexPointer( 3 , GL_FLOAT, 0, verts );
glDrawArrays( GL_POINTS, 0, 4 );

u dont want to draw to many elements in one hit eg if youre drawing 100,000 points use say 10 calls of 10,000 points or 20 calls of 5000 points.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.