本文整理匯總了Java中processing.core.PGraphics.is3D方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.is3D方法的具體用法?Java PGraphics.is3D怎麽用?Java PGraphics.is3D使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.is3D方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 2, 3);
PGraphics pg = (PGraphics) params.get(0);
if (pg.is3D() && 4 != params.size()) {
throw new WarpScriptException(getName() + " missing z-coordinate.");
}
if (pg.is3D()) {
pg.point(((Number) params.get(1)).floatValue(), ((Number) params.get(2)).floatValue(), ((Number) params.get(3)).floatValue());
} else {
pg.point(((Number) params.get(1)).floatValue(), ((Number) params.get(2)).floatValue());
}
stack.push(pg);
return stack;
}
示例2: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 4, 6);
PGraphics pg = (PGraphics) params.get(0);
if (pg.is3D() && 7 != params.size()) {
throw new WarpScriptException(getName() + " missing z-coordinates.");
}
if (pg.is3D()) {
pg.line(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue(),
((Number) params.get(5)).floatValue(),
((Number) params.get(6)).floatValue()
);
} else {
pg.line(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue()
);
}
stack.push(pg);
return stack;
}
示例3: beginScreen2D
import processing.core.PGraphics; //導入方法依賴的package包/類
static public void beginScreen2D(PGraphics pg){
pg.pushStyle();
pg.hint(PConstants.DISABLE_DEPTH_TEST);
pg.pushMatrix();
pg.resetMatrix();
if(pg.isGL() && pg.is3D()){
PGraphicsOpenGL pgl = (PGraphicsOpenGL)pg;
pushed_lights = pgl.lights;
pgl.lights = false;
pgl.pushProjection();
pgl.ortho(0, pg.width, -pg.height, 0, -Float.MAX_VALUE, +Float.MAX_VALUE);
}
}
示例4: endScreen2D
import processing.core.PGraphics; //導入方法依賴的package包/類
static public void endScreen2D(PGraphics pg){
if(pg.isGL() && pg.is3D()){
PGraphicsOpenGL pgl = (PGraphicsOpenGL)pg;
pgl.popProjection();
pgl.lights = pushed_lights;
}
pg.popMatrix();
pg.hint(PConstants.ENABLE_DEPTH_TEST);
pg.popStyle();
}
示例5: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 8, 12);
PGraphics pg = (PGraphics) params.get(0);
if (9 == params.size()) {
pg.bezier(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue(),
((Number) params.get(5)).floatValue(),
((Number) params.get(6)).floatValue(),
((Number) params.get(7)).floatValue(),
((Number) params.get(8)).floatValue()
);
} else if (pg.is3D()) {
pg.bezier(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue(),
((Number) params.get(5)).floatValue(),
((Number) params.get(6)).floatValue(),
((Number) params.get(7)).floatValue(),
((Number) params.get(8)).floatValue(),
((Number) params.get(9)).floatValue(),
((Number) params.get(10)).floatValue(),
((Number) params.get(11)).floatValue(),
((Number) params.get(12)).floatValue()
);
} else {
throw new WarpScriptException(getName() + " need a 3D container to draw a 3D Bezier curve.");
}
stack.push(pg);
return stack;
}
示例6: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 8, 12);
PGraphics pg = (PGraphics) params.get(0);
if (9 == params.size()) {
pg.curve(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue(),
((Number) params.get(5)).floatValue(),
((Number) params.get(6)).floatValue(),
((Number) params.get(7)).floatValue(),
((Number) params.get(8)).floatValue()
);
} else if (pg.is3D()) {
pg.curve(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue(),
((Number) params.get(5)).floatValue(),
((Number) params.get(6)).floatValue(),
((Number) params.get(7)).floatValue(),
((Number) params.get(8)).floatValue(),
((Number) params.get(9)).floatValue(),
((Number) params.get(10)).floatValue(),
((Number) params.get(11)).floatValue(),
((Number) params.get(12)).floatValue()
);
} else {
throw new WarpScriptException(getName() + " need a 3D container to draw a 3D Bezier curve.");
}
stack.push(pg);
return stack;
}