We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
POINT() in OpengGL (Read 2095 times)
POINT() in OpengGL
Jun 15th, 2007, 6:47pm
 
hi everybody?
Could somebody explain me why it happens?

I´m trying to use point with OPENGL and i´ve got nothing more than an empty window.

I´m using this example

size(100, 100, OPENGL);
point(30, 20, -50);
point(85, 20, -50);
point(85, 75, -50);
point(30, 75, -50);

(i´ve changed P3D/OPENGL).

thnx!
Re: POINT() in OpengGL
Reply #1 - Jun 15th, 2007, 6:53pm
 
in my experience point() didnt work in opengl aswell

my examples work as:

line( x, y, z, x, y+some_value, z );

some_value scale depending on your app and camera distance.

Re: POINT() in OpengGL
Reply #2 - Jun 16th, 2007, 12:36am
 
I've looked into this a bit, as on my computer point() fails in OpenGL, too.  The short answer is, apparently, that some graphics cards for one reason or another just don't draw points very well.

The long answer is that the way point() is implemented in the graphics library is as a very short line, from x,y -> x+epsilon,y+epsilon where epsilon is really small.  This isn't really the correct way to draw a point in OpenGL, (GL_POINTS would be) so depending on your hardware it may or may not draw anything.  On my hardware, even drawing GL_POINTS doesn't force the graphics card to render the points, it just seems to ignore the call.  Then again, maybe I'm doing something wrong, I'm not sure.

From other posts it sounds like point() works for some people, so I don't know if this can really be considered a Processing bug as much as an OpenGL implementation one.  Can anyone think of a good solution other than manually transforming and setting the desired pixels (which can be quite slow in OpenGL)?
Re: POINT() in OpengGL
Reply #3 - Jun 16th, 2007, 4:56am
 
yep, it's on the todo list (core/todo.txt in svn).

http://dev.processing.org/bugs/show_bug.cgi?id=121
http://dev.processing.org/bugs/show_bug.cgi?id=269

using GL_POINTS with opengl will fix part of it, but it won't help java2d (which suffers from the same issues.

it should also be noted that set() is often a better choice if you're looking for single pixels in 2D.

or in opengl, it's possible to use beginGL(), followed by glBeginShape(GL_POINTS), then draw your points that way.
Re: POINT() in OpengGL
Reply #4 - Jun 21st, 2007, 1:47am
 
Thanks everybody!
u r always there!
let's try some (GL_POINTS)
by the way, you'll get here my config.

i don't know if this info is helpful

Powerbook 1,33 ghz Power PC G4
ATI Mobility Radeon 9700:
 Chipset Model:ATY,RV360M11
 Type:Display
 Bus:AGP
 VRAM (Total):64 MB
 Vendor:ATI (0x1002)
 Device ID:0x4e50
 Revision ID:0x0000
 ROM Revision:113-xxxxx-134

saludos!
Page Index Toggle Pages: 1