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


Java PGraphics.is3D方法代碼示例

本文整理匯總了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;
}
 
開發者ID:cityzendata,項目名稱:warp10-platform,代碼行數:22,代碼來源:Ppoint.java

示例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;
}
 
開發者ID:cityzendata,項目名稱:warp10-platform,代碼行數:34,代碼來源:Pline.java

示例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);
  }
}
 
開發者ID:diwi,項目名稱:PixelFlow,代碼行數:14,代碼來源:DwUtils.java

示例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();
}
 
開發者ID:diwi,項目名稱:PixelFlow,代碼行數:11,代碼來源:DwUtils.java

示例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;
}
 
開發者ID:cityzendata,項目名稱:warp10-platform,代碼行數:42,代碼來源:Pbezier.java

示例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;
}
 
開發者ID:cityzendata,項目名稱:warp10-platform,代碼行數:42,代碼來源:Pcurve.java


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