本文整理汇总了Java中javax.media.j3d.Alpha类的典型用法代码示例。如果您正苦于以下问题:Java Alpha类的具体用法?Java Alpha怎么用?Java Alpha使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Alpha类属于javax.media.j3d包,在下文中一共展示了Alpha类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generation
import javax.media.j3d.Alpha; //导入依赖的package包/类
/**
* Génère la représentation
* @param feat
* @param time
* @param tMinLayer
* @param tMaxLayer
* @param alpha
* @param b
*/
private void generation(IFeature feat, List<Double> time, double tMinLayer,
double tMaxLayer, Alpha alpha, BranchGroup b) {
this.feat = feat;
// On génère des informations relatives à l'objet tMin et tMax
int nbT = time.size();
this.tMin = Double.POSITIVE_INFINITY;
this.tMax = Double.NEGATIVE_INFINITY;
for (int i = 0; i < nbT; i++) {
if (time.get(i) > this.tMax) {
this.tMax = time.get(i);
}
if (time.get(i) < this.tMin) {
this.tMin = time.get(i);
}
}
this.bGRep.addChild(this.generateBG(feat.getGeom().coord(), time,
tMinLayer, tMaxLayer, alpha, b));
this.bGRep.compile();
}
开发者ID:IGNF,项目名称:geoxygene,代码行数:35,代码来源:Object4d.java
示例2: makeSpin
import javax.media.j3d.Alpha; //导入依赖的package包/类
private RotationInterpolator makeSpin(TransformGroup spinner) {
//Alpha alpha = new Alpha(1, Alpha.DECREASING_ENABLE, 0, 10000, 5000, 0, 1000, 5000, 0, 1000);
Alpha alpha = new Alpha(1, 3000);//new Alpha(-1, 10000) set speed here
alpha.setAlphaAtOneDuration(3000);
alpha.setIncreasingAlphaRampDuration(500);
alpha.setMode(Alpha.INCREASING_ENABLE);
rotator = new RotationInterpolator(alpha, spinner);
double rot = Math.toRadians(90);
Transform3D rotate1 = new Transform3D();
rotate1.rotX(rot);
rotate1.setTranslation(new Vector3f(0.3f, 0.3f, 0.0f));
rotator.setTransformAxis(rotate1);
rotator.setSchedulingBounds(bounds);
return rotator;
}
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:17,代码来源:NeuGenVisualization.java
示例3: createSceneGraph
import javax.media.j3d.Alpha; //导入依赖的package包/类
/**
* Creates a scene graph for the 3D model, translates the model on the
* y-axis by {@code MODEL_Y_POSITION} and sets the rotation.
*
* @return a BranchGroup for the 3D model.
*/
private BranchGroup createSceneGraph() {
BranchGroup objRoot = new BranchGroup();
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
objRoot.addChild(objTrans);
// Move the shape down on the y-axis
TransformGroup moveDownGroup = new TransformGroup();
Transform3D moveDownTrans = new Transform3D();
moveDownTrans.setTranslation(new Vector3f(0, MODEL_Y_POSITION, 0));
moveDownGroup.setTransform(moveDownTrans);
objTrans.addChild(moveDownGroup);
moveDownGroup.addChild(this.shape3d);
// Rotate the shape
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, ROTATION_ALPHA_DURATION);
RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objTrans, yAxis, 0, (float) Math.PI * 2.0f);
BoundingSphere bounds = new BoundingSphere(new Point3d(0, 0, 0), ROTATOR_SPHERE_RADIUS);
rotator.setSchedulingBounds(bounds);
objRoot.addChild(rotator);
objRoot.compile();
return objRoot;
}
开发者ID:nerdouille,项目名称:silvie,代码行数:29,代码来源:ModelPreviewer.java
示例4: generateStyle
import javax.media.j3d.Alpha; //导入依赖的package包/类
/**
* Génère les objets Java3D
* @param duree durée en seconde de la simulation
* @param path chemin d'un fichier (si nécessaire)
* @param size informations de taille
* @param representationMode mode de représentation
*/
private void generateStyle(int duree, String path, double size,
int representationMode, double rotX, double rotY, double rotZ) {
int nbElem = this.collection.size();
// Alpha correspond au temps nécessaire pour faire un parcours
this.alpha = new Alpha(-1, duree * 1000);
for (int i = 0; i < nbElem; i++) {
IFeature feat = this.collection.get(i);
feat.setRepresentation(new Object4d(feat, this.time.get(i), this.tMin,
this.tMax, this.alpha, path, size, representationMode, rotX, rotY,
rotZ));
}
}
开发者ID:IGNF,项目名称:geoxygene,代码行数:21,代码来源:DynamicVectorLayer.java
示例5: main
import javax.media.j3d.Alpha; //导入依赖的package包/类
public static void main(String input[])
{
VolumeViewerPanel vol = new VolumeViewerPanel();
FrameFactroy.getFrame(vol);
// just after canvas and universe creation
generateVideo(vol.getRender().getCanvas(), vol.getRender()
.getUniverse(), 10000, new Alpha(), new File(
"c:\\test\\movie.avi"), 30, 600, 480);
}
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:11,代码来源:Test.java
示例6: createSceneGraph
import javax.media.j3d.Alpha; //导入依赖的package包/类
/**
* �V�[�����\�z����
* @return BG
*/
public BranchGroup createSceneGraph() {
BranchGroup bg = new BranchGroup();
// ��]�pTG
TransformGroup spinTG = new TransformGroup();
spinTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
// ��]�^��
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,
spinTG);
// �͈͂��w��
BoundingSphere bounds = new BoundingSphere();
rotator.setSchedulingBounds(bounds);
spinTG.addChild(rotator);
// �g���C�t�H�[�X
Triforce triforce = new Triforce();
spinTG.addChild(triforce.getBG()); // spinTG�ɒlj��I
bg.addChild(spinTG);
return bg;
}
开发者ID:aidiary,项目名称:javagame,代码行数:31,代码来源:Main3D.java
示例7: createSceneGraph
import javax.media.j3d.Alpha; //导入依赖的package包/类
public BranchGroup createSceneGraph() {
BranchGroup bg = new BranchGroup();
// �L���[�u���X����
Transform3D rotate = new Transform3D();
Transform3D tempRotate = new Transform3D();
rotate.rotX(Math.PI / 4.0);
tempRotate.rotY(Math.PI / 4.0);
rotate.mul(tempRotate);
TransformGroup rotateTG = new TransformGroup(rotate);
// �L���[�u����]����
TransformGroup spinTG = new TransformGroup();
spinTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
// �J���[�L���[�u���쐬����spinTG�ɒlj�
ColorCube cube = new ColorCube(0.4);
spinTG.addChild(cube);
// ��]�^��
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, spinTG);
// �͈͂��w��
BoundingSphere bounds = new BoundingSphere();
rotator.setSchedulingBounds(bounds);
spinTG.addChild(rotator);
rotateTG.addChild(spinTG);
bg.addChild(rotateTG);
return bg;
}
开发者ID:aidiary,项目名称:javagame,代码行数:34,代码来源:RotatingCube.java
示例8: createPlanete
import javax.media.j3d.Alpha; //导入依赖的package包/类
/**
* Create a group componsed of a sphere and different transform group + a hostname label
* @param root where adding the "sphere group" in 3D scene
* @param i body to represent
* @param a appearance of the sphere which represent the body
*/
private void createPlanete(BranchGroup root, int i, Appearance a) {
// Creation of the Root Animation Node of the planet
TransformGroup planeteAnimationGroup = new TransformGroup();
planeteAnimationGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
translationsGroup[i] = planeteAnimationGroup;
// Allow to Translate the Node of the planet
Transform3D translationPlanete = new Transform3D();
translations[i] = translationPlanete;
// Creating floating hostname label near the planet
BranchGroup lGroup = new BranchGroup();
lGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
lGroup.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
lGroup.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
labels[i] = lGroup;
// Rotation of the planet on itself
TransformGroup planeteRotationGroup = new TransformGroup();
planeteRotationGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
Alpha planeteRotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator = new RotationInterpolator(planeteRotationAlpha, planeteRotationGroup);
rotator.setSchedulingBounds(new BoundingSphere(new Point3d(0, 0, 0), 999999999));
planetesScalingGroup[i] = planeteRotationGroup;
// Allow to change the Scale of the sphere representing the planet
Transform3D planeteScaling = new Transform3D();
planeteRotationGroup.setTransform(planeteScaling);
planetesScaling[i] = planeteScaling;
// Creation of the sphere representing the planete
Sphere planete = new Sphere(0.01f, Sphere.GENERATE_NORMALS, 80, a);
// Assembling java3D nodes
planeteRotationGroup.addChild(planete);
planeteAnimationGroup.addChild(lGroup);
planeteAnimationGroup.addChild(planeteRotationGroup);
root.addChild(planeteAnimationGroup);
}
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:46,代码来源:NBody3DFrame.java
示例9: generateVideo
import javax.media.j3d.Alpha; //导入依赖的package包/类
public static void generateVideo(Canvas3D canvas3D, SimpleUniverse universe, long animationTime, Alpha alpha, File outputFile, int fps, int width, int height)
{
/* Initializing the animation */
long startTime = alpha.getStartTime();
alpha.pause(startTime);
/* Milliseconds it takes to change the frame. */
long msFrame = (long) (((float) 1 / fps) * 1000);
/* Frames you need to create the movie */
long framesNeeded = animationTime / msFrame;
/* Create an offscreen canvas from where you'll get the image */
ScreenShot screenShot = new ScreenShot(canvas3D, universe, 1f);
// canvas3D.getView().addCanvas3D(screenShot);
/*
* CREATE FRAMES
*/
String tempDir = "c:\\test\\";
String name = "img_";
String fileType = "jpg";
File fTempDir = new File(tempDir);
Vector<File> vFiles = new Vector<File>();
System.gc();
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
for (long frameCount = 0; frameCount <= framesNeeded; frameCount++)
{
/* Stop the animation in the correct position */
long time = startTime + frameCount * msFrame;
alpha.pause(time);
/* Get the renderized image at that moment */
BufferedImage bi = screenShot.doRender(image);
/* Create a JPEG file from the renderized image */
String tempName = name + frameCount;
File file = new File(fTempDir, tempName + "." + fileType);
try
{
ImageIO.write(bi, fileType, file);
} catch (IOException ex)
{
ex.printStackTrace();
return;
}
vFiles.add(file);
}
// /*
// * GENERATE VIDEO
// */
//
// int frameRate = (int) ((framesNeeded + 1) / (animationTime / 1000));
//
// File[] files = vFiles.toArray(new File[0]);
//
// try
// {
// MovieMaker movieMaker = new MovieMaker(width, height, frameRate,
// outputFile, files);
//
// movieMaker.makeMovie();
// } catch (Exception ex)
// {
// ex.printStackTrace();
// }
}
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:75,代码来源:Test.java
示例10: makeVideo
import javax.media.j3d.Alpha; //导入依赖的package包/类
public void makeVideo() {
MovieMaker.generateVideo(canvas3D, simpleUniverse, 10000, // Animation time in msec
new Alpha(-1, 32000), new File("MovieDensNuc.mov"), 15, 1920, 1200);
}
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:6,代码来源:VRLDensityVisualization.java
示例11: getRotation
import javax.media.j3d.Alpha; //导入依赖的package包/类
private TransformGroup getRotation() {
/*
* Create a TransformGroup to rotate the objects in the scene
* and set the capability bits on the TransformGroup so that
* it can be modified at runtime by the rotation behavior.
*/
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
//Create a spherical bounding volume that will define the volume
//within which the rotation behavior is active.
BoundingSphere bounds = new BoundingSphere(
new Point3d(0.0, 0.0, 0.0), 100.0);
//Create a 4 × 4 transformation matrix
Transform3D yAxis = new Transform3D();
double rot = Math.toRadians(90);
yAxis.rotZ(rot);
/*
* Create an Alpha interpolator to automatically generate
* modifications to the rotation component of the transformation
* matrix. This Alpha loops indefinitely and generates numbers
* from 0 to 1 every 4000 milliseconds.
*/
/*
Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,
0, 0,
32000, 0, 0,
0, 0, 0);
*
*/
Alpha rotationAlpha = new Alpha(-1, 0);
/*
* Create a RotationInterpolator behavior to effect the
* TransformGroup. Here we will rotate from 0 to 2p degrees about
* the Y-axis based on the output of rotationAlpha.
*/
rotator = new RotationInterpolator(rotationAlpha,
objTrans, yAxis, 0.0f,
(float) Math.PI * 2.0f);
//Set the scheduling bounds on the behavior. This defines the
//volume within which this behavior will be active.
rotator.setSchedulingBounds(bounds);
//Add the behavior to the scenegraph so that Java 3D
//can schedule it for activation.
objTrans.addChild(rotator);
return objTrans;
}
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:55,代码来源:VRLDensityVisualization.java
示例12: getRotation
import javax.media.j3d.Alpha; //导入依赖的package包/类
private TransformGroup getRotation() {
/*
* Create a TransformGroup to rotate the objects in the scene
* and set the capability bits on the TransformGroup so that
* it can be modified at runtime by the rotation behavior.
*/
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
//Create a spherical bounding volume that will define the volume
//within which the rotation behavior is active.
BoundingSphere bounds = new BoundingSphere(
new Point3d(0.0, 0.0, 0.0), 100.0);
//Create a 4 × 4 transformation matrix
Transform3D yAxis = new Transform3D();
double rot = Math.toRadians(90);
yAxis.rotZ(rot);
/*
* Create an Alpha interpolator to automatically generate
* modifications to the rotation component of the transformation
* matrix. This Alpha loops indefinitely and generates numbers
* from 0 to 1 every 4000 milliseconds.
*/
/*
Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,
0, 0,
32000, 0, 0,
0, 0, 0);
*
*/
Alpha rotationAlpha = new Alpha(-1, 0);
/*
* Create a RotationInterpolator behavior to effect the
* TransformGroup. Here we will rotate from 0 to 2p degrees about
* the Y-axis based on the output of rotationAlpha.
*/
rotator = new RotationInterpolator(rotationAlpha,
objTrans, yAxis, 0.0f,
(float) Math.PI * 2.0f);
//Set the scheduling bounds on the behavior. This defines the
//volume within which this behavior will be active.
rotator.setSchedulingBounds(bounds);
//Add the behavior to the scenegraph so that Java 3D
//can schedule it for activation.
objTrans.addChild(rotator);
return objTrans;
}
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:55,代码来源:NeuGenDensityVisualization.java
注:本文中的javax.media.j3d.Alpha类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论