首页 > 文档 > translate(30, 20)变换坐标系
2017
07-13

translate(30, 20)变换坐标系

translatetranslate(30, 20)变换坐标系

 

示例

translate(30, 20)变换坐标系 - 第1张  | Processing编程艺术

translate(30, 20);

rect(0, 0, 55, 55);

translate(30, 20)变换坐标系 - 第2张  | Processing编程艺术

// Translating in 3D requires P3D

// as the parameter to size()

size(100, 100, P3D);

// Translate 30 across, 20 down, and

// 50 back, or "away" from the screen.

translate(30, 20, -50);

rect(0, 0, 55, 55);

translate(30, 20)变换坐标系 - 第3张  | Processing编程艺术

rect(0, 0, 55, 55);  // Draw rect at original 0,0

translate(30, 20);

rect(0, 0, 55, 55);  // Draw rect at new 0,0

translate(14, 14);

rect(0, 0, 55, 55);  // Draw rect at new 0,0

描述

将(x,y,z)所在的一点坐标变成原点(0,0),通常用pushMatrix()popMatrix()联用。

语法

translate(x, y)

translate(x, y, z)


 



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。