/** * <code>initialize</code> builds the data for the <code>Quad</code> object. * * @param width * the width of the <code>Quad</code>. * @param height * the height of the <code>Quad</code>. */ private void initialize(final double width, final double height) { final int verts = 4; _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(verts)); _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(verts)); final FloatBuffer tbuf = BufferUtils.createVector2Buffer(verts); _meshData.setTextureBuffer(tbuf, 0); _meshData.getNormalBuffer().put(0).put(0).put(1); _meshData.getNormalBuffer().put(0).put(0).put(1); _meshData.getNormalBuffer().put(0).put(0).put(1); _meshData.getNormalBuffer().put(0).put(0).put(1); tbuf.put(0).put(1); tbuf.put(0).put(0); tbuf.put(1).put(0); tbuf.put(1).put(1); final byte[] indices = { 0, 1, 2, 0, 2, 3 }; final ByteBuffer buf = BufferUtils.createByteBuffer(indices.length); buf.put(indices); buf.rewind(); _meshData.setIndexBuffer(buf); resize(width, height); }
/** * <code>initialize</code> builds the data for the <code>Quad</code> object. * * @param width * the width of the <code>Quad</code>. * @param height * the height of the <code>Quad</code>. */ private void initialize(final double width, final double height) { final int verts = 4; _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(verts)); _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(verts)); final FloatBuffer tbuf = BufferUtils.createVector2Buffer(verts); _meshData.setTextureBuffer(tbuf, 0); _meshData.getNormalBuffer().put(0).put(0).put(1); _meshData.getNormalBuffer().put(0).put(0).put(1); _meshData.getNormalBuffer().put(0).put(0).put(1); _meshData.getNormalBuffer().put(0).put(0).put(1); tbuf.put(0).put(1); tbuf.put(0).put(0); tbuf.put(1).put(0); tbuf.put(1).put(1); final byte[] indices = { 0, 1, 2, 0, 2, 3 }; final ByteBuffer buf = BufferUtils.createByteBuffer(indices.length); buf.put(indices); buf.rewind(); _meshData.setIndexBuffer(buf); resize(width, height); }
lastY -= maxY; _bgQuad.resize(texWidth, texHeight - lastY); _bgQuad.setRenderState(_defBlendState); _bgQuad.setTranslation(texWidth / 2f, texHeight - (texHeight - lastY) / 2f, 0);
r.flushGraphics(); double locationX = cam.getWidth(), locationY = cam.getHeight(); bQuad.resize(size, (cam.getHeight() / (double) cam.getWidth()) * size); if (bQuad.getLocalRenderState(RenderState.StateType.Texture) == null) { final TextureState ts = new TextureState();
lastY -= maxY; _bgQuad.resize(texWidth, texHeight - lastY); _bgQuad.setRenderState(_defBlendState); _bgQuad.setTranslation(texWidth / 2f, texHeight - (texHeight - lastY) / 2f, 0);
r.flushGraphics(); double locationX = cam.getWidth(), locationY = cam.getHeight(); bQuad.resize(size, (cam.getHeight() / (double) cam.getWidth()) * size); if (bQuad.getLocalRenderState(RenderState.StateType.Texture) == null) { final TextureState ts = new TextureState();
public QuadImposterNode(final String name, final int twidth, final int theight, final int depth, final int samples, final Timer timer) { super(name); _twidth = twidth; _theight = theight; _depth = depth; _samples = samples; _timer = timer; _texture = new Texture2D(); _imposterQuad = new Quad("ImposterQuad"); _imposterQuad.resize(1, 1); _imposterQuad.setModelBound(new BoundingBox()); _imposterQuad.getSceneHints().setTextureCombineMode(TextureCombineMode.Replace); _imposterQuad.getSceneHints().setLightCombineMode(LightCombineMode.Off); super.attachChild(_imposterQuad); getSceneHints().setRenderBucketType(RenderBucketType.Transparent); _targetScene = new Node(); super.attachChild(_targetScene); for (int i = 0; i < _corners.length; i++) { _corners[i] = new Vector3(); } if (timer != null) { _redrawRate = _elapsed = 0.05; // 20x per sec } else { setCameraAngleThreshold(10.0); setCameraDistanceThreshold(0.2); } _haveDrawn = false; }
public QuadImposterNode(final String name, final int twidth, final int theight, final int depth, final int samples, final Timer timer) { super(name); _twidth = twidth; _theight = theight; _depth = depth; _samples = samples; _timer = timer; _texture = new Texture2D(); _imposterQuad = new Quad("ImposterQuad"); _imposterQuad.resize(1, 1); _imposterQuad.setModelBound(new BoundingBox()); _imposterQuad.getSceneHints().setTextureCombineMode(TextureCombineMode.Replace); _imposterQuad.getSceneHints().setLightCombineMode(LightCombineMode.Off); super.attachChild(_imposterQuad); getSceneHints().setRenderBucketType(RenderBucketType.Transparent); _targetScene = new Node(); super.attachChild(_targetScene); for (int i = 0; i < _corners.length; i++) { _corners[i] = new Vector3(); } if (timer != null) { _redrawRate = _elapsed = 0.05; // 20x per sec } else { setCameraAngleThreshold(10.0); setCameraDistanceThreshold(0.2); } _haveDrawn = false; }