【发布时间】:2011-03-29 10:03:51
【问题描述】:
在处理中将局部相对点转换为世界(屏幕)空间的好方法是什么?
例如,以 Processing PDE 附带的Flocking example 为例。我将如何在Boid 类中实现relativeToWorld 方法和worldToRelative 方法。这些方法会考虑到在render 方法中完成的所有转换。
我想我想要转换 PVector 对象,所以方法签名可能看起来像:
PVector relativeToWorld(PVector relative) {
// Take a relative PVector and return a world PVector.
}
PVector worldToRelative(PVector world) {
// Take a world PVector and return a relative PVector.
}
【问题讨论】:
-
这篇文章可能对你有帮助:stackoverflow.com/questions/8339533/…
标签: java transformation processing coordinate-transformation