Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


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.

  • You cannot reply to this topic
7 replies to this topic

#1 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

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

Sponsor:

#2 core114   Members   -  Reputation: 122

Like
Likes
Like

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.


#3 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 02 August 2001 - 07:02 PM


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

#4 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

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.

#5 Uros Bergant   Members   -  Reputation: 122

Like
Likes
Like

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

#6 panda_master   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 August 2001 - 02:11 AM

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


#7 Julio   Members   -  Reputation: 116

Like
Likes
Like

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

#8 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

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.



PARTNERS