Texturing with a Movie not displaying properly
in
Core Library Questions
•
1 month ago
Trying to use a movie as a texture but it isn't displaying properly- I just get an extreme close-up, almost like a single pixel. I'm completely new to textures so I might just be missing something incredibly obvious. Here's my code:
- import processing.video.*;
- Movie waves;
- float radius, step;
- int points;
- void setup(){
- size(1280, 720, P2D);
- background(0);
- waves = new Movie(this, "waves.mov");
- waves.loop();
- radius = 200;
- points = 6;
- step = TAU / points;
- }
- void draw(){
- background(0);
- image(waves, 0, 0);
- pushMatrix();
- stroke(255);
- strokeWeight(2);
- translate(width/2, height/2);
- textureMode(NORMAL);
- beginShape();
- texture(waves);
- for(int i = 0; i < points; i++){
- float theta = step * i;
- float x = cos(theta);
- float y = sin(theta);
- vertex(x * radius, y * radius);
- }
- endShape(CLOSE);
- popMatrix();
- void movieEvent(Movie m) {
- m.read();
- }
1