Back to project page wannabe.
The source code is released under:
MIT License
If you think the Android project wannabe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
// Copyright 2013 Patrick Forhan. package wannabe.projection; //from w w w.ja v a 2 s. c om import wannabe.Camera; import wannabe.Position; import wannabe.Rendered; import wannabe.Voxel; /** * Renders {@link Voxel}s with a constant center point, but with an differing a size to represent * height. */ public class Flat implements Projection { private final Rendered rendered = new Rendered(); @Override public Rendered render(Camera camera, Position position, int pixelSize) { position = camera.translate(position); // TODO tweak, not sure what a good value is here: int zOffset = position.z / 4; rendered.left = pixelSize * position.x - zOffset + camera.uiPosition.left; rendered.top = pixelSize * position.y - zOffset + camera.uiPosition.top; rendered.size = pixelSize + zOffset << 1; return rendered; } }