如何改变试验室世界输出的坐标系?谢谢。
http://postimg.org/image/71d6fner5/
http://postimg.org/image/upx9oo0oh/
我决定了这个问题。
我将重写DebugDraw,并在构造函数中将YFlip设置为false。
ViewportTransform.setYFlip(假);
public class EnginePanelJ2D extends JPanel implements TestbedPanel {
// (other code from org.jbox2d.testbed.framework.j2d.TestPanelJ2D)
public EnginePanelJ2D(TestbedModel argModel) {
draw = new EngineDebugDraw(this);
// other code
}
}EngineDebugDraw
public class EngineDebugDraw extends DebugDraw {
// (other code from org.jbox2d.testbed.framework.j2d.DebugDrawJ2D)
public EngineDebugDraw(EnginePanelJ2D argTestPanel) {
// other code
viewportTransform.setYFlip(false);
}
}仅此而已
发布于 2013-11-24 19:11:33
您可以通过修改视口转换的矩阵来更改视口的所有内容。这就是为什么它在那里。例如,使用Mat22.createRotationMatrix (或类似的内容),如果要旋转视图,则执行viewportTransform.mulBy(Mat22.createRotationMatrix(__))。你也可以变换它,等等。
https://stackoverflow.com/questions/20173325
复制相似问题