Advertisement

Drawing Points, PLEASE help!

Started by July 09, 2001 05:19 PM
7 comments, last by TerraX 23 years, 7 months ago
I''ve been trying to draw some simple points, but they just don''t want to show up, I''ve tried disabling lighting, blending etc, but it''s still a whooping failure Here''s my code.... void Scene7Main(void) // Main file that displays stuff { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glColor4f(1.0f,1.0f,1.0f,1.0f); glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glBegin(GL_POINTS); glVertex3f(0,0,-1); glEnd(); } Am I missing something? Please help, TerraX.
  void Scene7Main(void) // Main file that displays stuff{   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);   glLoadIdentity();   glTranslatef(0.0f, 0.0f, -6.0f);   glColor3f(1.0f,1.0f,1.0f);   glBegin(GL_POINTS);      glVertex3f(0.0f, 0.0f, 0.0f);   glEnd();}  


try that,
Scott
Advertisement
Wojtos, cheerz for replying, but still no luck

I forgot to mention, I''ve also tried increasing the size of the points using glPointSize(float);
But that doesn''t work either
hehe, I can''t draw the most primitive of things! ARGH!!!
Please help
Weird, I have no idea why that wouldn''t work... Probably depends on what else you have in your code. Have u tried looking at NeHe''s tutorials? they go through step by step.

NeHe Productions

Scott
How do you have your resize function set up? Its possible that the points are being drawn in a location that the camera currently isn''t looking at. Also, if you have texture mapping turned on, you probably won''t be able to see the points.
This may sound silly, but are you sure you''re calling that function to render the scene?

I know I did something like that once I wrote a whole drawing function then wondered why I didn''t see anything - it was because I''d forgotton to call it in my main loop

Failing that, try drawing something like a triangle because your point size may be messed up (i.e. too small to see for some reason) I can''t think of anything else.

Call glPointSize(the_size_you_want) to try making it bigger.

-Mezz
Advertisement
1) what is the background colour of your scene? because if it''s white, then you wont see the point because you''ve set its colour to white also.

2) are you sure the camera is facing towards the point at (0,0,-1)? Just incase you didnt know, (0,0,-1) is a point in the game space, not a point one unit into your screen in the direction you''re facing (because you haven''t set mode to orographic projection).

Just wondering.,.

"You are just as irritating to me as an irrational term that accidentially creeps into your equation and cannot be factorized out."
draw a triangle or something (do u see it on the screen if so do this)

glPointSize(10)
glPolygonMode( GL_FRONT_AND_BACK, GL_POINTS )
draw the same triangle

http://members.xoom.com/myBollux
Blimey!!! Cheerz for all the replies peepz

As usual, it was something simple, I woke up this morning and thought, hmmm, perhaps it''s because I''ve forgotten to turn off the 2D texturing state (also in derickdong''s reply), so I tried that and lo and behold, it worked!!

Again, thanks for all the help peepz

This topic is closed to new replies.

Advertisement