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.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Drawing points(); in OpenGL
Page Index Toggle Pages: 1
Drawing points(); in OpenGL? (Read 525 times)
Drawing points(); in OpenGL?
Feb 27th, 2008, 1:35pm
 
I don't get it...the points don't appear?!?

Is there any special code needed for points in 3D/OpenGL?

Heres my code (without the rotating methods)

import processing.opengl.*;
import damkjer.ocd.*;
import java.awt.image.*;
import java.text.*;
import processing.opengl.*;
import javax.media.opengl.*;  


Camera camera1;



void setup()
{
 size(800, 600, OPENGL);
 noStroke();
 camera1 = new Camera(this, -300, 0, 400);

}

void draw()
{
 
 background(125);
 lights();
 camera1.feed();

 
 //Sphere #1
 noStroke();
 pushMatrix();
 translate(50,100,10);;
 fill (85,198,23);
 sphereDetail(60);
 smooth();
 sphere(40);

 
 
 
 //Sphere #2
 noStroke();
 translate(20,50,70);
 fill (23,23,198);
 sphereDetail(60);
 smooth();
 sphere(40);

 
 
 //Sphere #3
 noStroke();
 translate(20,100,50);
 fill (249,145,22);
 sphereDetail(60);
 smooth();
 sphere(40);
 popMatrix();
 
 

 zoomZ();
 rotateIt();
 //helixA();
 
 pushMatrix();
 for (float z = 0 ; z < 2*PI ; z += 0.1) {
 stroke(3);
 fill(255);
 point( cos(6*z), sin(6*z), z);
 line(  cos(6*z), sin(6*z), z,6*z);
  }
 popMatrix();
 
}
Re: Drawing points(); in OpenGL?
Reply #1 - Feb 27th, 2008, 1:55pm
 
Okay, solved it...the points were just tooooo far away in the z-layer.

Hm..how do I cange the color of the points: fill(something?) or stroke(rgb)?
Page Index Toggle Pages: 1