Просмотрите наши продукты

Aspose.3D for Java 19,9 Примечания к выпуску

Улучшения и изменения

КлючСводкаКатегория
THREEDNET-532Экспорт 3D сцены в HTMLНовая функция
THREEDNET-561Выставить свойства геометрического преобразованияУлучшение
THREEDNET-556Геометрическое вращение кажется неправильнымОшибка

Публичные API и обратные несовместимые изменения

См. Список любых изменений, внесенных в общедоступный API, таких как добавленные, переименованные, удаленные или устаревшие члены, а также любые несовместимые назад изменения, внесенные в Aspose.3D for Java. Если у вас есть опасения по поводу каких-либо изменений, пожалуйста, поднимите их наФорум поддержки Aspose.3D.

Добавлены новые форматы файлов HTML5/ASPOSE3D _ WEB

 /**

\* Aspose.3D Web format.

*/

public static final FileFormat ASPOSE3D_WEB;

/**

\* HTML5 File

*/

public static final FileFormat HTML5;

При экспорте сцены в файл HTML5 фактически будет 3 файла, файл HTML, файл Aspose3DWeb (*.a3dw) и отрисованного файла JavaScript можно экспортировать только файл a3dw, указав Aspose3DWeb в качестве типа экспорта, и повторно использовать файл javascript на своей собственной странице HTML.

Код образца:

 Scene scene = new Scene();

Node node = scene.getRootNode().createChildNode(new Cylinder());

LambertMaterial mat = new LambertMaterial();

mat.setDiffuseColor(new Vector3(0.34,0.59, 0.41));

node.setMaterial(mat);

Light light = new Light();

light.setLightType(LightType.POINT);

scene.getRootNode().createChildNode(light).getTransform().setTranslation(10, 0, 10);

scene.save("test.html", FileFormat.HTML5);
 python3 -m http.server

Затем откройте егоhttp:// localhost:8000/test.html. Веб-рендерер использует WebGL2, вы можете использоватьhttps://get.webgl.org/webgl2/Чтобы проверить, поддерживает ли ваш браузер его или нет.

Добавлен новый класс com.aspose.threed.HTML5SaveOptions

Это позволяет настроить экспортированную страницу 3D HTML

Код образца:

 Scene scene = new Scene();

Node node = scene.getRootNode().createChildNode(new Cylinder());

LambertMaterial mat = new LambertMaterial();

mat.setDiffuseColor(new Vector3(0.34,0.59, 0.41));

node.setMaterial(mat);

Light light = new Light();

light.setLightType(LightType.POINT);

scene.getRootNode().createChildNode(light).getTransform().setTranslation(10, 0, 10);

HTML5SaveOptions opt = new HTML5SaveOptions();

opt.setShowGrid(false); // Turn off the grid

opt.setShowUI(false); //Turn off the user interface

scene.save("test.html", FileFormat.HTML5);

Добавлено новое свойство FileFormat в классе com.aspose.threed.IOConfig

 /**

 * Gets the file format that specified in current Save/Load option.

 */

public FileFormat getFileFormat();

Добавлен новый метод оценки GlobalTransform в классе com.aspose.threed.Node

 /**

 * Evaluate the global transform, include the geometric transform or not.

 * @param withGeometricTransform Whether the geometric transform is needed.

 */

public Matrix4 evaluateGlobalTransform(boolean withGeometricTransform);

Разница между Node.GlobalTransform.TransformMatrix заключается в том, что она позволяет получить матрицу преобразования с геометрическим преобразованием, которая влияет только на присоединенный объект и сохраняет незатронутые дочерние узлы.

Добавлен новый getter/setter getGeometricTranslation/setGeometricTranslation/getGeometricScaling/setGeometricRotation в классе com.aspose.threed. Преобразование

 /**

 * Gets the geometric translation.

 * Geometric transformation only affects the entities attached and leave the child nodes unaffected.

 * It will be merged as local transformation when you export the geometric transformation to file types that does not support it.

 */

public Vector3 getGeometricTranslation();

/**

 * Sets the geometric translation.

 * Geometric transformation only affects the entities attached and leave the child nodes unaffected.

 * It will be merged as local transformation when you export the geometric transformation to file types that does not support it.

 * @param value New value

 */

public void setGeometricTranslation(Vector3 value);

/**

 * Gets the geometric scaling.

 * Geometric transformation only affects the entities attached and leave the child nodes unaffected.

 * It will be merged as local transformation when you export the geometric transformation to file types that does not support it.

 */

public Vector3 getGeometricScaling();

/**

 * Sets the geometric scaling.

 * Geometric transformation only affects the entities attached and leave the child nodes unaffected.

 * It will be merged as local transformation when you export the geometric transformation to file types that does not support it.

 * @param value New value

 */

public void setGeometricScaling(Vector3 value);

/**

 * Gets the geometric euler rotation(measured in degree).

 * Geometric transformation only affects the entities attached and leave the child nodes unaffected.

 * It will be merged as local transformation when you export the geometric transformation to file types that does not support it.

 */

public Vector3 getGeometricRotation();

/**

 * Sets the geometric euler rotation(measured in degree).

 * Geometric transformation only affects the entities attached and leave the child nodes unaffected.

 * It will be merged as local transformation when you export the geometric transformation to file types that does not support it.

 * @param value New value

 */

public void setGeometricRotation(Vector3 value);

Код образца:

 Node n = new Node();

n.getTransform().setGeometricTranslation(new Vector3(10, 0, 0));

System.out.println(n.evaluateGlobalTransform(true));

System.out.println(n.evaluateGlobalTransform(false));

Первый оператор печати выводит матрицу преобразования, которая включает геометрическое преобразование, а второй-нет.


 
 Русский