Material Properties and Shapes
in
Programming Questions
•
2 years ago
So, I'm writing a program to test various things. all in all i've figured out most of what i wanted to know from this program. i do have one or two questions though.
I can't seem to get Material Properties like emissive() working on my Mesh ( beginShape() to endShape() ). I don't get an error, however nothing seems to happen no matter how i do it and i can't seem to find a whole lot of documentation on it... What am i doing wrong? Can this be done at all?
second... Is there any way to display a Billboard or Halo sprite in 3d?
Thanks in advance!
- import processing.video.*;
- PVector camLoc;
- PVector camLookAt;
- PVector camUp;
- float count = 0;
- Capture cam;
- PImage tex = new PImage(320,240);
- void setup()
- {
- size(640,480,P3D);
- noStroke();
- //init cam info
- camLoc = new PVector(0,0,-10);
- camLookAt = new PVector(0,0,0);
- camUp = new PVector(0,1,0);
- cam = new Capture(this, 320,240);
- }
- void draw()
- {
- background(0,0,255);
- //pull cam texture
- if (cam.available() == true)
- {
- cam.read();
- tex = cam;
- }
- //lights
- pointLight(255, 255, 255, 10, 10, -10);
- //camera
- camera(camLoc.x, camLoc.y, camLoc.z, camLookAt.x, camLookAt.y, camLookAt.z, camUp.x, camUp.y, camUp.z);
- //test shape
- emissive(1);
- beginShape();
- textureMode(NORMALIZED);
- texture(tex);
- vertex(-2,-2,0, 0,1);
- vertex(2,-2,0, 1,1);
- vertex(2,2,0, 1,0);
- vertex(-2,2,0, 0,0);
- rotateY(count);
- endShape();
- count = count + 0.01;
- }
1