本文整理汇总了Java中com.jme3.util.SkyFactory.createSky方法的典型用法代码示例。如果您正苦于以下问题:Java SkyFactory.createSky方法的具体用法?Java SkyFactory.createSky怎么用?Java SkyFactory.createSky使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.util.SkyFactory
的用法示例。
在下文中一共展示了SkyFactory.createSky方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleInitApp
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public void simpleInitApp() {
Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg");
Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg");
Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");
/*
Texture west = assetManager.loadTexture("Textures/Sky/Primitives/primitives_positive_x.png");
Texture east = assetManager.loadTexture("Textures/Sky/Primitives/primitives_negative_x.png");
Texture north = assetManager.loadTexture("Textures/Sky/Primitives/primitives_negative_z.png");
Texture south = assetManager.loadTexture("Textures/Sky/Primitives/primitives_positive_z.png");
Texture up = assetManager.loadTexture("Textures/Sky/Primitives/primitives_positive_y.png");
Texture down = assetManager.loadTexture("Textures/Sky/Primitives/primitives_negative_y.png");
*/
Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
rootNode.attachChild(sky);
}
示例2: simpleInitApp
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public void simpleInitApp() {
/*
Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg");
Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg");
Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");
*/
Texture west = assetManager.loadTexture("Textures/Sky/Primitives/primitives_positive_x.png");
Texture east = assetManager.loadTexture("Textures/Sky/Primitives/primitives_negative_x.png");
Texture north = assetManager.loadTexture("Textures/Sky/Primitives/primitives_negative_z.png");
Texture south = assetManager.loadTexture("Textures/Sky/Primitives/primitives_positive_z.png");
Texture up = assetManager.loadTexture("Textures/Sky/Primitives/primitives_positive_y.png");
Texture down = assetManager.loadTexture("Textures/Sky/Primitives/primitives_negative_y.png");
Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
rootNode.attachChild(sky);
}
示例3: loadSkyBoxes
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
/**
* Loads up the sky boxes into fields, ready to use
* @param am
* The asset manager used to load the textures from
*/
private void loadSkyBoxes(AssetManager am){
daySkyBox = SkyFactory.createSky(am,
am.loadTexture("/Textures/skybox/day_right.jpg"),
am.loadTexture("/Textures/skybox/day_left.jpg"),
am.loadTexture("/Textures/skybox/day_back.jpg"),
am.loadTexture("/Textures/skybox/day_front.jpg"),
am.loadTexture("/Textures/skybox/day_top.jpg"),
am.loadTexture("/Textures/skybox/day_top.jpg"));
nightSkyBox = SkyFactory.createSky(am,
am.loadTexture("/Textures/skybox/night_right.jpg"),
am.loadTexture("/Textures/skybox/night_left.jpg"),
am.loadTexture("/Textures/skybox/night_back.jpg"),
am.loadTexture("/Textures/skybox/night_front.jpg"),
am.loadTexture("/Textures/skybox/night_top.jpg"),
am.loadTexture("/Textures/skybox/night_bottom.jpg"));
daySkyBox.setShadowMode(ShadowMode.Off);
nightSkyBox.setShadowMode(ShadowMode.Off);
}
示例4: AdvancedPBRWithStudioSky3DEditorState
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public AdvancedPBRWithStudioSky3DEditorState(@NotNull final T fileEditor) {
super(fileEditor);
final AssetManager assetManager = EDITOR.getAssetManager();
final Geometry sky = (Geometry) SkyFactory.createSky(assetManager, "graphics/textures/sky/studio.hdr",
SkyFactory.EnvMapType.EquirectMap);
final Node stateNode = getStateNode();
stateNode.attachChild(sky);
}
示例5: prepareScene
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
/**
* Prepare a transfer processor to transfer preview result to a image view.
*
* @return the transfer processor.
*/
@JMEThread
private @NotNull FrameTransferSceneProcessor prepareScene() {
final Editor editor = Editor.getInstance();
final AssetManager assetManager = editor.getAssetManager();
final Spatial sky = SkyFactory.createSky(assetManager, "graphics/textures/sky/studio.hdr",
SkyFactory.EnvMapType.EquirectMap);
final DirectionalLight light = new DirectionalLight();
light.setDirection(LIGHT_DIRECTION);
final Node cameraNode = new Node("Camera node");
final Node rootNode = editor.getPreviewNode();
rootNode.addControl(this);
rootNode.attachChild(sky);
rootNode.addLight(light);
rootNode.attachChild(cameraNode);
rootNode.attachChild(modelNode);
final Camera camera = editor.getPreviewCamera();
final EditorCamera editorCamera = new EditorCamera(camera, cameraNode);
editorCamera.setMaxDistance(10000);
editorCamera.setMinDistance(0.01F);
editorCamera.setSmoothMotion(false);
editorCamera.setRotationSensitivity(1);
editorCamera.setZoomSensitivity(0.2F);
//TODO added supporting moving the camera
processor = bind(editor, imageView, imageView, editor.getPreviewViewPort(), false);
processor.setTransferMode(ON_CHANGES);
processor.setEnabled(false);
return processor;
}
示例6: createSky
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
private void createSky() {
Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg");
Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg");
Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");
Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
rootNode.attachChild(sky);
}
示例7: simpleInitApp
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public void simpleInitApp() {
Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg");
Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg");
Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");
Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
rootNode.attachChild(sky);
}
示例8: doCreateSky
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
private Spatial doCreateSky(Node parent,
Texture west,
Texture east,
Texture north,
Texture south,
Texture top,
Texture bottom,
Vector3f normalScale)
{
AssetManager manager = SceneApplication.getApplication().getAssetManager();
Spatial sky = SkyFactory.createSky(manager, west, east, north, south, top, bottom, normalScale);
parent.attachChild(sky);
return sky;
}
示例9: loadModel
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
@Override
protected Spatial loadModel() {
AssetManager am = LuoYing.getApp().getAssetManager();
Texture w = am.loadTexture(baseDir != null ? baseDir + west : west);
Texture e = am.loadTexture(baseDir != null ? baseDir + east : east);
Texture n = am.loadTexture(baseDir != null ? baseDir + north : north);
Texture s = am.loadTexture(baseDir != null ? baseDir + south : south);
Texture u = am.loadTexture(baseDir != null ? baseDir + up : up);
Texture d = am.loadTexture(baseDir != null ? baseDir + down : down);
sky = SkyFactory.createSky(am, w, e, n, s, u, d);
return sky;
}
示例10: createSky
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
private void createSky() {
Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg");
Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg");
Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");
sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
rootNode.attachChild(sky);
}
示例11: loadSky
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
private void loadSky() {
AssetManager assetManager = HexScapeCore.getInstance().getHexScapeJme3Application().getAssetManager();
Texture west = assetManager.loadTexture("left.png");
Texture east = assetManager.loadTexture("right.png");
Texture north = assetManager.loadTexture("front.png");
Texture south = assetManager.loadTexture("back.png");
Texture up = assetManager.loadTexture("top.png");
Texture down = assetManager.loadTexture("bottom.png");
spatial = SkyFactory.createSky(HexScapeCore.getInstance().getHexScapeJme3Application().getAssetManager(), west, east, north, south, up, down);
spatial.setShadowMode(ShadowMode.Off);
}
示例12: SkyBox
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public SkyBox(AssetManager assetManager, Node rootNode)
{
String path = "Textures/skybox/";
skyBox = SkyFactory.createSky(assetManager,
assetManager.loadTexture(path + "caveLeft.png"),
assetManager.loadTexture(path + "caveRight.png"),
assetManager.loadTexture(path + "caveFront.png"),
assetManager.loadTexture(path + "caveBack.png"),
assetManager.loadTexture(path + "caveTop.png"),
assetManager.loadTexture(path + "caveDown.png"));
skyBox.setName("sky");
rootNode.attachChild(skyBox);
}
示例13: requestPreview
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public void requestPreview(String textureName, String displayName, int width, int height, JComponent picLabel, JLabel infoLabel) {
TextureKey key = new TextureKey(textureName);
picPreview = picLabel;
assetManager.deleteFromCache(key);
Texture t = assetManager.loadTexture(key);
Spatial geom = quad;
if (key.getTextureTypeHint() == Texture.Type.TwoDimensional) {
material.setTexture("ColorMap", t);
geom.setMaterial(material);
if (infoLabel != null) {
infoLabel.setText(" " + displayName + " w : " + t.getImage().getWidth() + " h : " + t.getImage().getHeight());
}
} else if (key.getTextureTypeHint() == Texture.Type.ThreeDimensional) {
geom = quad3D;
assetManager.deleteFromCache(key);
key.setAsTexture3D(true);
t = assetManager.loadTexture(key);
material3D.setTexture("Texture", t);
geom.setMaterial(material3D);
if (infoLabel != null) {
infoLabel.setText(" " + displayName + " (Texture3D) w : " + t.getImage().getWidth() + " h : " + t.getImage().getHeight() + " d : " + t.getImage().getDepth());
}
} else if (key.getTextureTypeHint() == Texture.Type.CubeMap) {
assetManager.deleteFromCache(key);
geom = SkyFactory.createSky(assetManager, textureName, false);
if (infoLabel != null) {
infoLabel.setText(" " + displayName + " (CubeMap) w : " + t.getImage().getWidth() + " h : " + t.getImage().getHeight());
}
}
PreviewRequest request = new PreviewRequest(this, geom, width, height);
request.getCameraRequest().setLocation(new Vector3f(0, 0, 5.3f));
request.getCameraRequest().setLookAt(new Vector3f(0, 0, 0), Vector3f.UNIT_Y.mult(-1));
SceneApplication.getApplication().createPreview(request);
}
示例14: getSky
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
public Spatial getSky(AssetManager assetManager) {
return SkyFactory.createSky(
assetManager, assetManager.loadTexture("Textures/skydome.png"),
new Vector3f(0.8f, 1f, 1f).normalize()/*Vector3f.UNIT_XYZ*/, true, 200050);
}
示例15: simpleInitApp
import com.jme3.util.SkyFactory; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
// put the camera in a bad position
cam.setLocation(new Vector3f(-2.336393f, 11.91392f, -7.139601f));
cam.setRotation(new Quaternion(0.23602544f, 0.11321983f, -0.027698677f, 0.96473104f));
//cam.setFrustumFar(1000);
Material mat = new Material(assetManager,"Common/MatDefs/Light/Lighting.j3md");
mat.setFloat("Shininess", 15f);
mat.setBoolean("UseMaterialColors", true);
mat.setColor("Ambient", ColorRGBA.Yellow.mult(0.2f));
mat.setColor("Diffuse", ColorRGBA.Yellow.mult(0.2f));
mat.setColor("Specular", ColorRGBA.Yellow.mult(0.8f));
Material matSoil = new Material(assetManager,"Common/MatDefs/Light/Lighting.j3md");
matSoil.setFloat("Shininess", 15f);
matSoil.setBoolean("UseMaterialColors", true);
matSoil.setColor("Ambient", ColorRGBA.Gray);
matSoil.setColor("Diffuse", ColorRGBA.Black);
matSoil.setColor("Specular", ColorRGBA.Gray);
teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
teapot.setLocalTranslation(0,0,10);
teapot.setMaterial(mat);
teapot.setShadowMode(ShadowMode.CastAndReceive);
teapot.setLocalScale(10.0f);
rootNode.attachChild(teapot);
Geometry soil=new Geometry("soil", new Box(new Vector3f(0, -13, 550), 800, 10, 700));
soil.setMaterial(matSoil);
soil.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(soil);
DirectionalLight light=new DirectionalLight();
light.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
light.setColor(ColorRGBA.White.mult(1.5f));
rootNode.addLight(light);
// load sky
Spatial sky = SkyFactory.createSky(assetManager, "Textures/Sky/Bright/FullskiesBlueClear03.dds", false);
sky.setCullHint(Spatial.CullHint.Never);
rootNode.attachChild(sky);
fpp=new FilterPostProcessor(assetManager);
PosterizationFilter pf=new PosterizationFilter();
viewPort.addProcessor(fpp);
fpp.addFilter(pf);
initInputs();
}