자바 질문
조회수 245회
string[] friends= new string[3]; PImage img; String[] pic = { "1.png", "2.png", "3.png" };
void setup(){ size(400, 400, P3D); noFill(); img= loadImage("1.png", "2.png", "3.png"); textureMode(NORMAL); camera(width/2, height/2, (height/2) / tan(PI/6), width/2, height/2, 0, 0, 1, 0); friends = new string[3]; for ( int i=0; i<friends.length; i++) { img = loadImage( pic[ int(random(pic.length)) ] ); } }
void draw(){ background(0); translate(width / 2, height / 2); for(int i=0; i<friends.length; i++){ img = loadImage( pic[ int(random(pic.length)) ] ); friends[i] = i+1; } }
class string{ texture(img); string( ){ beginShape(QUADS); vertex(-1, -1, 1, 0, 0); vertex( 1, -1, 1, 1, 0); vertex( 1, 1, 1, 1, 1); vertex(-1, 1, 1, 0, 1); endShape();
beginShape(QUADS); vertex(-1, 1, 1, 0, 0); vertex( 1, 1, 1, 1, 0); vertex( 1, 1, -1, 1, 1); vertex(-1, 1, -1, 0, 1); endShape();
beginShape(QUADS); vertex( 1, -1, 1, 0, 0); vertex( 1, -1, -1, 1, 0); vertex( 1, 1, -1, 1, 1); vertex( 1, 1, 1, 0, 1); endShape(); } }
클래스 안에 있는 텍스쳐 부분에 밑줄이 가고 실행이 안돼요..뭐가 문제인가요..?
댓글 입력