本文整理汇总了Java中processing.core.PMatrix类的典型用法代码示例。如果您正苦于以下问题:Java PMatrix类的具体用法?Java PMatrix怎么用?Java PMatrix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PMatrix类属于processing.core包,在下文中一共展示了PMatrix类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNormalVectors
import processing.core.PMatrix; //导入依赖的package包/类
/**
* Gets the normal vectors of the cube object
*
* @return A list object contain the normal vectors
*/
public List <PVector> getNormalVectors( )
{
final List <PVector> normals = new LinkedList <PVector>();
final PMatrix rotMatrix = getRotationMatrix();
PVector current = new PVector(1, 0, 0);
current = rotMatrix.mult(current, null);
normals.add(current);
current = new PVector(0, 1, 0);
current = rotMatrix.mult(current, null);
normals.add(current);
current = new PVector(0, 0, 1);
current = rotMatrix.mult(current, null);
normals.add(current);
return normals;
}
开发者ID:RobertTatoian,项目名称:FaceMapping,代码行数:26,代码来源:Cube.java
示例2: resetMatrix
import processing.core.PMatrix; //导入依赖的package包/类
@Override
public void resetMatrix() {
if (shapeCreated && matrix != null && transformStack != null) {
if (family == GROUP) {
updateTessellation();
}
if (tessellated) {
PMatrix mat = popTransform();
while (mat != null) {
boolean res = mat.invert();
if (res) {
applyMatrixImpl(mat);
} else {
PGraphics.showWarning("Transformation applied on the shape cannot be inverted");
}
mat = popTransform();
}
}
matrix.reset();
transformStack.clear();
}
}
开发者ID:d2fn,项目名称:passage,代码行数:23,代码来源:PShapeOpenGL.java
示例3: applyMatrixImpl
import processing.core.PMatrix; //导入依赖的package包/类
protected void applyMatrixImpl(PMatrix matrix) {
if (hasPolys) {
tessGeo.applyMatrixOnPolyGeometry(matrix,
firstPolyVertex, lastPolyVertex);
root.setModifiedPolyVertices(firstPolyVertex, lastPolyVertex);
root.setModifiedPolyNormals(firstPolyVertex, lastPolyVertex);
}
if (is3D()) {
if (hasLines) {
tessGeo.applyMatrixOnLineGeometry(matrix,
firstLineVertex, lastLineVertex);
root.setModifiedLineVertices(firstLineVertex, lastLineVertex);
root.setModifiedLineAttributes(firstLineVertex, lastLineVertex);
}
if (hasPoints) {
tessGeo.applyMatrixOnPointGeometry(matrix,
firstPointVertex, lastPointVertex);
root.setModifiedPointVertices(firstPointVertex, lastPointVertex);
}
}
}
开发者ID:d2fn,项目名称:passage,代码行数:24,代码来源:PShapeOpenGL.java
示例4: getRotationMatrix
import processing.core.PMatrix; //导入依赖的package包/类
public PMatrix getRotationMatrix( )
{
// Use PGraphics to get the transformation matrix. Might induce some
// overhead,
// but it's much simpler.
final PGraphics g = new PGraphics3D();
g.rotateX(getRotationX());
g.rotateY(getRotationY());
g.rotateZ(getRotationZ());
return g.getMatrix();
}
开发者ID:RobertTatoian,项目名称:FaceMapping,代码行数:13,代码来源:GraphicObject3D.java
示例5: getTransformationMatrix
import processing.core.PMatrix; //导入依赖的package包/类
/**
* Returns the transformation matrix from the parent's reference frame to
* this object's reference frame.
*
* @return A 4-dimensional matrix (that is, PMatrix3d)
*/
public PMatrix getTransformationMatrix( )
{
// Use PGraphics to get the transformation matrix. Might induce some
// overhead,
// but it's much simpler.
final PGraphics g = new PGraphics3D();
g.translate(getTranslationX(), getTranslationY(), getTranslationZ());
g.rotateX(getRotationX());
g.rotateY(getRotationY());
g.rotateZ(getRotationZ());
return g.getMatrix();
}
开发者ID:RobertTatoian,项目名称:FaceMapping,代码行数:20,代码来源:GraphicObject3D.java
示例6: parentToRelativeCoordinates
import processing.core.PMatrix; //导入依赖的package包/类
/**
* Converts a point in the parent's coordinate system to this object's
* reference frame.
*
* @param pos
* A vector that contains the positon of the object
* @return The point in the object's reference frame
*/
public PVector parentToRelativeCoordinates(PVector pos)
{
if (getParent() != null)
{
pos = parentToRelativeCoordinates(pos);
}
final PMatrix transMatrix = getTransformationMatrix();
return transMatrix.mult(pos, null);
}
开发者ID:RobertTatoian,项目名称:FaceMapping,代码行数:19,代码来源:GraphicObject3D.java
示例7: relativeToParentCoordinates
import processing.core.PMatrix; //导入依赖的package包/类
/**
* Converts a point in this object's reference frame to the reference frame
* of the parent.
*
* @param pos
* A vector that contains the positon of the object
* @return The point in the parent's reference frame.
*/
public PVector relativeToParentCoordinates(PVector pos)
{
if (getParent() != null)
{
pos = parentToRelativeCoordinates(pos);
}
final PMatrix transMatrix = getTransformationMatrix();
return transMatrix.mult(pos, null);
}
开发者ID:RobertTatoian,项目名称:FaceMapping,代码行数:19,代码来源:GraphicObject3D.java
示例8: preRender
import processing.core.PMatrix; //导入依赖的package包/类
public void preRender(PApplet p) {
update();
p.pushMatrix();
double[] matrix = new double[6];
getTransformMatrix().getMatrix(matrix);
PMatrix m = new PMatrix2D((float)matrix[0], (float)matrix[2], (float)matrix[4], (float)matrix[1], (float)matrix[3], (float)matrix[5]);
p.applyMatrix(m);
}
开发者ID:nuigroup,项目名称:hci-for-java,代码行数:10,代码来源:AbstractComponent.java
示例9: getShapeTransform
import processing.core.PMatrix; //导入依赖的package包/类
public PMatrix getShapeTransform(){
return shp_transform;
}
开发者ID:diwi,项目名称:PixelFlow,代码行数:4,代码来源:DwParticle.java
示例10: getMatrix
import processing.core.PMatrix; //导入依赖的package包/类
public PMatrix getMatrix() {
return currentGraphics.getMatrix();
}
开发者ID:poqudrof,项目名称:PapARt,代码行数:4,代码来源:PaperScreen.java
示例11: applyMatrix
import processing.core.PMatrix; //导入依赖的package包/类
public void applyMatrix(PMatrix source) {
currentGraphics.applyMatrix(source);
}
开发者ID:poqudrof,项目名称:PapARt,代码行数:4,代码来源:PaperScreen.java
示例12: setMatrix
import processing.core.PMatrix; //导入依赖的package包/类
public void setMatrix(PMatrix source) {
currentGraphics.setMatrix(source);
}
开发者ID:poqudrof,项目名称:PapARt,代码行数:4,代码来源:PaperScreen.java
示例13: popTransform
import processing.core.PMatrix; //导入依赖的package包/类
protected PMatrix popTransform() {
if (transformStack == null || transformStack.size() == 0) return null;
return transformStack.pop();
}
开发者ID:d2fn,项目名称:passage,代码行数:5,代码来源:PShapeOpenGL.java
注:本文中的processing.core.PMatrix类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论