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
A few questions (Read 1163 times)
A few questions
May 31st, 2005, 8:11pm
 
Hello processing folks.

Im working on a project for share (http://share.dj). Im the webmaster/db/php programming guy, and id like to visualize some multimedia we have in our database in a specific way, but first I have a few questions on processing, its conventions, and openGL.

1) Are the units of measure always pixels, or are they ever openGL 'metrics', ie 1/2/3 without any 'units'?. If so, when is each used (are there guidelines at all?) IE: if I create a scene with size(300, 300, P3D);, I understand 'width' will be '300', but if I use that in an openGL context.. am I still using the right units?

2) FSAA with jogl? Can I enable a smoother/AA'd display for my applets I create? IM specifically looking to smooth onscreen text in an openGL environment, as they look pretty shoddy...

3) OCD library: I have some code I am experimenting with, and I am getting odd POV with my camera controls.. (I copied them from the reference library), but it seems to really alter the aspect ratio and the focal length when I move my mouse around. What am I doing wrong? (code below).

4) Mysql (yes I know this isnt the right area, sorry :) ). Ive read a few posts about mysql slowing things down. I am assuming this is because calls are being made during the draw() routine. Mysql doesnt inheritly slow anything down does it (if used right of course)?

I have to say, yesterday was my first day using processing, and already im drawing to openGL, pulling things in from mySQL and displaying them. Its a very friendly language. Well done developers, im impressed.


/*
 vade::shareCMS visualizer test.
 eventually we will integrate mysql, pull media URLS and associated metadata for events,
 put them in a timeline, and make it sexy as shit. phj34r.
 
*/

// import OCD Library
import damkjer.ocd.*;
Camera cam1; // new instance of OCD Camera

PFont displayFont; // define our font.

void setup()
{
 // basics
 size(300, 300, P3D);
 framerate(30);
 //OCD Camera & pos.
 cam1 = new Camera(this, 50, -125, 180);
 
 // load up our font resource
 displayFont = loadFont("Univers45.vlw.gz");
}

void draw()
{
 //initial drawing setup..
 background(105, 105, 105);
 lights();
 cam1.feed();
 
 // line with date text..

 pushMatrix();
   beginShape(LINES);
   stroke(255);
   translate(width/2, height/2, 0); // center drawing..
   vertex(-200,0,0);
   vertex(200,0,0);
   for(int i= 0; i< 41; i++) // draw our map unit ticks...
   {
    // stroke((i*  )) // gradiate color ..
     vertex ( ((i* 10) -200), 0, 0);
     vertex ( ((i* 10) -200), 10, 0);  
   }

 endShape();
 popMatrix();  
// text

 pushMatrix();
   translate(width/2, height/2, 0);
   rotateY(90);
   textFont(displayFont, 20); // set font..
   text("Date", 0, 0, 0);
 popMatrix();

// reset camera/perspective to draw logo over everything..
camera();
perspective();
pushMatrix();
  translate(5, height-5, 0);
  textFont(displayFont, 20); // reset font size..
  text("vade::s-cmsVisualizer// 0.1 b", 0, 0, 0);
popMatrix();

}

void mouseMoved()
{
 cam1.circle(radians(mouseX - pmouseX));
 cam1.zoom(radians(mouseY - pmouseY) / 2.0);
}


Re: A few questions
Reply #1 - May 31st, 2005, 9:35pm
 
Ah,I realize now that I wasnt in fact using an openGL context, but a P3D one. What are the differences between P3D and openGL? Text looks much nicer now, but it seems some OCD functions are broken? Thanks,
Page Index Toggle Pages: 1