當前位置: 首頁>>代碼示例>>Java>>正文


Java PConstants.TWO_PI屬性代碼示例

本文整理匯總了Java中processing.core.PConstants.TWO_PI屬性的典型用法代碼示例。如果您正苦於以下問題:Java PConstants.TWO_PI屬性的具體用法?Java PConstants.TWO_PI怎麽用?Java PConstants.TWO_PI使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在processing.core.PConstants的用法示例。


在下文中一共展示了PConstants.TWO_PI屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawApp

public void drawApp() {
        p.background(255);
//		p.fill(255, 40);
//		p.rect(0, 0, p.width, p.height);
        p.noStroke();
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float easedPercent = Penner.easeInOutQuart(percentComplete, 0, 1, 1);

        float frameOsc = P.sin( PConstants.TWO_PI * percentComplete);
//		float elloSize = (float)(p.width/1.5f + 7f * frameOsc);
        float elloSize = (float)(p.width);
        
        DrawUtil.setDrawCorner(p);
        
        p.translate(p.width/2, p.height/2);
//		p.rotate(frameRadians * p.frameCount);
        p.rotate(easedPercent * PConstants.TWO_PI);
        p.shape(_logo, 0, 0, elloSize, elloSize);
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:21,代碼來源:GifRenderEllo002RotateEased.java

示例2: drawGraphics

public void drawGraphics(PGraphics pg) {
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
//		float easedPercent = Penner.easeInOutExpo(percentComplete, 0, 1, 1);
//		float easedPercent = Penner.easeInOutQuart(percentComplete, 0, 1, 1);
        float easedPercent = Penner.easeInOutCubic(percentComplete, 0, 1, 1);

        float frameOsc = P.sin( PConstants.TWO_PI * percentComplete);
        float elloSize = (float)(p.width);
        
        DrawUtil.setDrawCenter(pg);
        pg.beginDraw();
        pg.clear();
        pg.background(255);
        pg.noStroke();

        pg.translate(pg.width/2, pg.height/2);
        float rotations = 2;
        pg.rotate(easedPercent * PConstants.TWO_PI * rotations);
        pg.shape(_logo, 0, 0, elloSize, elloSize);

        pg.endDraw();
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:24,代碼來源:GifRenderEllo025LoadingAnimationV3.java

示例3: drawApp

public void drawApp() {
        p.background(255);
        p.noStroke();
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float easedPercent = Penner.easeInOutQuart(percentComplete, 0, 1, 1);

        float frameOsc = P.sin( PConstants.TWO_PI * percentComplete);
        float scale = 0.95f;
        float oscSize = 0.1f;
        float elloSize = (float)(p.width * (scale - oscSize + oscSize * frameOsc));
//		float elloSize = (float)(40 * (scale - oscSize + oscSize * frameOsc));	// with padding
        
        DrawUtil.setDrawCenter(p);
        
        p.translate(p.width/2, p.height/2);
//		p.rotate(frameRadians * p.frameCount);
//		p.rotate(easedPercent * PConstants.TWO_PI);
        p.fill(ColorUtil.colorFromHex("#DFDFDF"));
        p.stroke(0,0);
        p.ellipse(0, 0, elloSize, elloSize);
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:23,代碼來源:GifRenderEllo015InfiniteScrollLoader.java

示例4: drawGraphics

public void drawGraphics( PGraphics pg ) {
//		if(p.frameCount == 1) p.background(255);
        pg.beginDraw();
        pg.clear();

//		pg.background(255);
        pg.noStroke();
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float progressRads = percentComplete * P.TWO_PI;
        float easedPercent = Penner.easeInOutQuart(percentComplete, 0, 1, 1);

        
        // Bread!
        pg.translate(p.width/2, p.height/2);
        DrawUtil.setDrawCenter(pg);
        DrawUtil.setPImageAlpha(pg, 0.3f);
        pg.scale(0.9f + P.sin(progressRads) * 0.1f);
        pg.rotate(0.01f * P.sin(P.PI/2 + progressRads));
        pg.image(biglyImg, 0, 0);

        pg.endDraw();
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:24,代碼來源:BiglyText.java

示例5: drawApp

public void drawApp() {
        p.background(255);
//		p.fill(255, 40);
//		p.rect(0, 0, p.width, p.height);
        p.noStroke();
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float easedPercent = Penner.easeInOutQuart(percentComplete, 0, 1, 1);

        float frameOsc = P.sin( PConstants.TWO_PI * percentComplete);
        float elloSize = (float)((p.width - p.width*0.02) + p.width*0.02 * frameOsc);
//		float elloSize = (float)(p.width);
        
        
        p.translate(p.width/2, p.height/2);
//		p.rotate(frameRadians * p.frameCount);
//		p.rotate(easedPercent * PConstants.TWO_PI);
        
        // Ello logo
//		DrawUtil.setDrawCorner(p);
//		p.shape(_logo, 0, 0, elloSize, elloSize);
        
        // Bread!
        DrawUtil.setDrawCenter(p);
        p.image(_bread, 0, 0, elloSize, elloSize);
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:27,代碼來源:GifRenderEllo002ScaleEased.java

示例6: drawApp

public void drawApp() {
        p.background(255);
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        
        if(percentComplete == 0)
            _elloSize *= 4;
        
        DrawUtil.setDrawCorner(p);
                
        float dist = percentComplete * (p.width + _elloSize*2);
        
        float x = -_elloSize + dist;
        float circumference = _elloSize * P.PI;
        float rotationRads = (x / circumference) * P.TWO_PI;
        
        p.pushMatrix();
        p.translate(x, p.height - _elloSize/2f);
        p.rotate(rotationRads);
        p.shape(_logo, 0, 0, _elloSize, _elloSize);
        p.popMatrix();

//		filter(INVERT);

        if(p.appConfig.getBoolean("rendering_gif", false) == true) renderGifFrame();
        if( p.frameCount == _frames * 4 + 5 ) {
            if(p.appConfig.getBoolean("rendering_gif", false) ==  true) encoder.finish();
            if(movieRenderer != null) {				
                movieRenderer.stop();
                P.println("render done!");
            }
        }

    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:35,代碼來源:GifRenderEllo005RollAcross.java

示例7: drawApp

public void drawApp() {
        if(p.appConfig.getBoolean(AppSettings.SUNFLOW_ACTIVE, false) == true) {
            joons.jr.background(0,0,0); //background(gray), or (r, g, b), like Processing.
            joons.jr.background("gi_ambient_occlusion"); //Global illumination, ambient occlusion mode.
            joons.jr.background("gi_instant"); //Global illumination, normal mode.
            joons.jr.background("cornell_box", p.width, p.height, p.height); //cornellBox(width, height, depth);
        } else {			
            background(255);
            DrawUtil.setBasicLights(p);
        }
        p.noStroke();

        translate(width/2, height * 0.45f, -400);
//		translate(0,0,-1400);
        
//		p.shininess(200); 
//		p.lights();
//		p.ambientLight(0.3f,0.3f,0.3f, 0, 0, 6000);
//		p.ambientLight(0.3f,0.3f,0.3f, 0, 0, -6000);

    
//		p.rotateX(mouseY*0.01f);
//		p.rotateY(mouseX*0.01f);
        p.rotateX(P.PI/10);
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float easedPercent = Penner.easeInOutQuart(percentComplete, 0, 1, 1);
//		p.rotateY(percentComplete * P.TWO_PI);

//		drawImgWebCam();
//		drawImgBoxes();
        drawImgPyra();
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:34,代碼來源:ImageTo3D.java

示例8: drawApp

public void drawApp() {
        p.background(255);
//		p.fill(255, 40);
//		p.rect(0, 0, p.width, p.height);
        p.noStroke();
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float percentWhiteComplete = P.constrain(((float)(p.frameCount - (_frames/2))/_frames), 0, 1);
        float percentBlackComplete = P.constrain(((float)(p.frameCount)/_frames), 0, 1);
        float easedScale = Penner.easeInOutQuart(percentComplete, 0, 1, 1);
        float easedWhiteScale = Penner.easeInOutQuart(percentWhiteComplete, 0, 1, 1);
        float easedWhiteRot = 0.6f - Penner.easeInOutSine(percentWhiteComplete, 0, 1, 1);
        float easedBlackScale = Penner.easeInOutQuart(percentBlackComplete, 0, 1, 1);
        float easedBlackRot = -0.6f + Penner.easeInOutSine(percentBlackComplete, 0, 1f, 1);

        float frameOsc = P.sin( PConstants.TWO_PI * percentComplete);
//		float elloSize = (float)(p.width/1.5f + 7f * frameOsc);
        float elloSize = (float)(p.width/1.5f);
        
        DrawUtil.setDrawCorner(p);
        
        p.translate(p.width/2, p.height/2);
//		p.rotate(frameRadians * p.frameCount);
        
//		P.println("frame",frameCount);
        
        p.pushMatrix();
        p.scale(easedBlackScale * 5f);
        p.rotate(easedBlackRot);
        p.shape(_logo, 0, 0, elloSize, elloSize);
        p.popMatrix();
        
        p.pushMatrix();
        p.scale(easedWhiteScale * 5f);
        p.rotate(easedWhiteRot);
        p.shape(_logoInverse, 0, 0, elloSize, elloSize);
        p.popMatrix();


        if(p.appConfig.getBoolean("rendering_gif", false) ==  true) renderGifFrame();
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:42,代碼來源:GifRenderEllo003ZoomInBW.java

示例9: drawApp

public void drawApp() {
        p.background(255);
//		p.fill(255, 40);
//		p.rect(0, 0, p.width, p.height);
        p.noStroke();
        
//		ambientLight(102, 102, 102);
//		lightSpecular(204, 204, 204);
//		directionalLight(102, 102, 102, 0, 0, -1);
//		specular(255, 255, 255);
//		emissive(51, 51, 51);
//		ambient(50, 50, 50);
//		shininess(50.0f); 
        

        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
        float easedScale = Penner.easeInOutQuart(percentComplete, 0, 1, 1);

        float frameOsc = P.sin( PConstants.TWO_PI * percentComplete);
//		float elloSize = (float)(p.width/1.5f + 7f * frameOsc);
        float elloSize = (float)(p.width/1.5f);
        
        DrawUtil.setDrawCorner(p);
        
        p.translate(p.width/2, p.height/2);
        
        p.pushMatrix();
        
        p.translate( 0, 0, -p.width*2.7f );
        p.rotateZ(P.PI);
        
//		// spin it - y-axis
//		p.rotateY(9.5f - percentComplete * 3.35f); 
//		// spin it - x-axis
//		p.rotateY(7.825f);
//		p.rotateZ(-P.PI/2f - -percentComplete * P.PI); 
//		// shake "no"
//		p.rotateY(P.PI/2 + P.sin(percentComplete * P.TWO_PI) * 0.2f); 
//		// shake "yes"
//		p.rotateY(P.PI/2); 
//		p.rotateZ(P.sin(percentComplete * P.TWO_PI) * 0.1f);
//		// mouse it
//		p.rotateY(p.mouseX / 20f); 
        
//		MeshUtil.deformMeshWithAudio( _sphereMesh, _deformMesh, p._audioInput, 10 );
    
        // draw texture. if tinting happened, reset after drawing
        if( _texture != null ) MeshUtilToxi.drawToxiMesh( p, Toxiclibs.instance(p).toxi, _deformMesh, _texture );
        
        p.popMatrix();
    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:53,代碼來源:GifRenderEllo004SphereTextureMap.java

示例10: drawApp

public void drawApp() {
        p.background(255);
        
        float frameRadians = PConstants.TWO_PI / _frames;
        float percentComplete = ((float)(p.frameCount%_frames)/_frames);
//		float easedPercent = Penner.easeInCirc(percentComplete, 0, 1, 1);
        
        DrawUtil.setDrawCorner(p);
        p.translate(p.width/2, p.height/2f);

        float iterateFactor = 3f;
        float origSize = p.width * 2f;
        float growth = ((origSize * iterateFactor * iterateFactor) - origSize);
        _elloSize = origSize + percentComplete * growth;

        int index = 0;
        while( _elloSize > 2 ) {
            p.pushMatrix();
            if(index % 2 == 0) {
                p.rotate(frameRadians * p.frameCount * (index+1));
//				p.fill(255);
                p.ellipse(0, 0, _elloSize, _elloSize);
                p.shape(_logo, 0, 0, _elloSize, _elloSize);
            } else {				
                p.rotate(frameRadians * p.frameCount * (index+1));
                p.shape(_logoInverse, 0, 0, _elloSize, _elloSize);
            }
            p.popMatrix();
            
            
            _elloSize /= iterateFactor;
            index++;
        }
        

//		filter(INVERT);

        if(p.appConfig.getBoolean("rendering_gif", false) == true) renderGifFrame();
        if( p.frameCount == _frames * 8 ) {
            if(p.appConfig.getBoolean("rendering_gif", false) ==  true) encoder.finish();
            if(_isRendering == true) {				
                movieRenderer.stop();
                P.println("render done!");
            }
        }

    }
 
開發者ID:cacheflowe,項目名稱:haxademic,代碼行數:47,代碼來源:GifRenderEllo006SpinTunnel.java


注:本文中的processing.core.PConstants.TWO_PI屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。