use of com.jme3.math.Vector3f in project jmonkeyengine by jMonkeyEngine.
the class TestPostFilters method setupSkyBox.
public void setupSkyBox() {
Texture envMap;
if (renderer.getCaps().contains(Caps.FloatTexture)) {
envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.hdr");
} else {
envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg");
}
rootNode.attachChild(SkyFactory.createSky(assetManager, envMap, new Vector3f(-1, -1, -1), true));
}
use of com.jme3.math.Vector3f in project jmonkeyengine by jMonkeyEngine.
the class TestPostFilters method setupLighting.
public void setupLighting() {
DirectionalLight dl = new DirectionalLight();
dl.setDirection(lightDir);
dl.setColor(new ColorRGBA(.9f, .9f, .9f, 1));
rootNode.addLight(dl);
dl = new DirectionalLight();
dl.setDirection(new Vector3f(1, 0, -1).normalizeLocal());
dl.setColor(new ColorRGBA(.4f, .4f, .4f, 1));
// rootNode.addLight(dl);
}
use of com.jme3.math.Vector3f in project jmonkeyengine by jMonkeyEngine.
the class TestPostFiltersCompositing method simpleInitApp.
public void simpleInitApp() {
this.flyCam.setMoveSpeed(10);
cam.setLocation(new Vector3f(0.028406568f, 2.015769f, 7.386517f));
cam.setRotation(new Quaternion(-1.0729783E-5f, 0.9999721f, -0.0073241726f, -0.0014647911f));
makeScene();
//Creating the main view port post processor
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
fpp.addFilter(new ColorOverlayFilter(ColorRGBA.Blue));
viewPort.addProcessor(fpp);
//creating a frame buffer for the mainviewport
FrameBuffer mainVPFrameBuffer = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1);
Texture2D mainVPTexture = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8);
mainVPFrameBuffer.addColorTexture(mainVPTexture);
mainVPFrameBuffer.setDepthBuffer(Image.Format.Depth);
viewPort.setOutputFrameBuffer(mainVPFrameBuffer);
//creating the post processor for the gui viewport
final FilterPostProcessor guifpp = new FilterPostProcessor(assetManager);
guifpp.setFrameBufferFormat(Image.Format.RGBA8);
guifpp.addFilter(new ColorOverlayFilter(ColorRGBA.Red));
//this will compose the main viewport texture with the guiviewport back buffer.
//Note that you can switch the order of the filters so that guiviewport filters are applied or not to the main viewport texture
guifpp.addFilter(new ComposeFilter(mainVPTexture));
guiViewPort.addProcessor(guifpp);
//compositing is done by mixing texture depending on the alpha channel,
//it's important that the guiviewport clear color alpha value is set to 0
guiViewPort.setBackgroundColor(ColorRGBA.BlackNoAlpha);
guiViewPort.setClearColor(true);
}
use of com.jme3.math.Vector3f in project jmonkeyengine by jMonkeyEngine.
the class TestPostFiltersCompositing method makeScene.
private void makeScene() {
// load sky
rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", SkyFactory.EnvMapType.CubeMap));
//assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/wildhouse.zip", HttpZipLocator.class);
Spatial scene = assetManager.loadModel("Models/Test/CornellBox.j3o");
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(-0.4790551f, -0.39247334f, -0.7851566f));
scene.addLight(sun);
rootNode.attachChild(scene);
}
use of com.jme3.math.Vector3f in project jmonkeyengine by jMonkeyEngine.
the class TestOgreComplexAnim method simpleInitApp.
@Override
public void simpleInitApp() {
flyCam.setMoveSpeed(10f);
cam.setLocation(new Vector3f(6.4013605f, 7.488437f, 12.843031f));
cam.setRotation(new Quaternion(-0.060740203f, 0.93925786f, -0.2398315f, -0.2378785f));
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal());
dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
rootNode.addLight(dl);
Node model = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
control = model.getControl(AnimControl.class);
AnimChannel feet = control.createChannel();
AnimChannel leftHand = control.createChannel();
AnimChannel rightHand = control.createChannel();
// feet will dodge
feet.addFromRootBone("hip.right");
feet.addFromRootBone("hip.left");
feet.setAnim("Dodge");
feet.setSpeed(2);
feet.setLoopMode(LoopMode.Cycle);
// will blend over 15 seconds to stand
feet.setAnim("Walk", 15);
feet.setSpeed(0.25f);
feet.setLoopMode(LoopMode.Cycle);
// left hand will pull
leftHand.addFromRootBone("uparm.right");
leftHand.setAnim("pull");
leftHand.setSpeed(.5f);
// will blend over 15 seconds to stand
leftHand.setAnim("stand", 15);
// right hand will push
rightHand.addBone("spinehigh");
rightHand.addFromRootBone("uparm.left");
rightHand.setAnim("push");
SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton());
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.setColor("Color", ColorRGBA.Green);
mat.getAdditionalRenderState().setDepthTest(false);
skeletonDebug.setMaterial(mat);
model.attachChild(skeletonDebug);
rootNode.attachChild(model);
}
Aggregations