Explore nuestros productos
Aspose.3D for .NET 19,9 Notas de la versión
Mejoras y cambios
Clave | Resumen | Categoría |
---|---|---|
THREEDNET-532 | Escena de exportación 3D a HTML | Nueva característica |
THREEDNET-561 | Exponer propiedades geométricas de transformación | Mejora |
THREEDNET-556 | La rotación geométrica parece incorrecta | Error |
Público API y cambios incompatibles al revés
Consulte la lista de cualquier cambio realizado al público API, como miembros agregados, renombrados, eliminados o obsoletados, así como cualquier cambio no compatible con versiones anteriores realizado a Aspose.3D for .NET. Si tiene inquietudes sobre cualquier cambio enumerado, por favor recújelo en elAspose.3D foro de apoyo.
Añadido nuevos formatos de archivo HTML5/Aspose3DWeb
/// <summary>
/// Aspose.3D Web format.
/// </summary>
public static readonly FileFormat Aspose3DWeb;
/// <summary>
/// HTML5 File
/// </summary>
public static readonly FileFormat HTML5;
Al exportar la escena al archivo HTML5, en realidad habrá 3 archivos, un archivo HTML, un archivo DWeb Aspose3 (*.a3dw) y un archivo JavaScript representado, solo puede exportar el archivo a3dw especificando el Aspose3DWeb como el tipo de exportación y reutilizar el archivo javascript dentro de su propia página HTML.
Código de muestra:
var scene = new Scene();
var node = scene.RootNode.CreateChildNode(new Cylinder());
node.Material = new LambertMaterial() { DiffuseColor = new Vector3(Color.Chartreuse) };
scene.RootNode.CreateChildNode(new Light() { LightType = LightType.Point }).Transform.Translation = new Vector3(10, 0, 10);
scene.Save(@"test.html", FileFormat.HTML5);
python3 -m http.server
Entonces ábrelohttp://localhost:8000/test.html… El renderizador web utiliza WebGL2, usted puede utilizarhttps://get.webgl.org/webgl2/Para comprobar si su navegador es compatible o no.
Añadido nueva clase Aspose.ThreeD. Formatos. HTML5SaveOptions
Esto le permite personalizar la página exportada 3D HTML
Código de muestra:
var scene = new Scene();
var node = scene.RootNode.CreateChildNode(new Cylinder());
node.Material = new LambertMaterial() { DiffuseColor = new Vector3(Color.Chartreuse) };
scene.RootNode.CreateChildNode(new Light() { LightType = LightType.Point }).Transform.Translation = new Vector3(10, 0, 10);
var opt = new HTML5SaveOptions();
opt.ShowGrid = false; //Turn off the grid
opt.ShowUI = false; //Turn off the user interface.
scene.Save(@"test.html", opt);
Se ha añadido la nueva propiedad FileFormat en la clase Aspose.ThreeD. Formatos. IOConfig
/// <summary>
/// Gets the file format that specified in current Save/Load option.
/// </summary>
public FileFormat FileFormat { get; }
Añadido nuevo método EvaluateGlobalTransform en la clase Aspose.ThreeD. Nodo
/// <summary>
/// Evaluate the global transform, include the geometric transform or not.
/// </summary>
/// <param name="withGeometricTransform">Whether the geometric transform is needed.</param>
/// <returns></returns>
public Matrix4 EvaluateGlobalTransform(bool withGeometricTransform);
La diferencia entre Nodo. GlobalTransform.TransformMatrix es que permite obtener una matriz de transformación con una transformación geométrica, que sólo afecta a la entidad adjunta y mantiene los nodos secundarios sin afectar.
Nuevas propiedades añadidas GeometricTranslation/Geometricing/GeometricRotation en la clase Aspose.ThreeD.Transform
/// <summary>
/// Gets or 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.
/// </summary>
public Vector3 GeometricTranslation {get; set;}
/// <summary>
/// Gets or 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.
/// </summary>
public Vector3 GeometricScaling {get; set;}
/// <summary>
/// Gets or 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.
/// </summary>
public Vector3 GeometricRotation {get; set; }
Código de muestra:
var n = new Node();
n.Transform.GeometricTranslation = new Vector3(10, 0, 0);
Console.WriteLine(n.EvaluateGlobalTransform(true));
Console.WriteLine(n.EvaluateGlobalTransform(false));
La primera Consola. WriteLine dará salida a la matriz de transformación que incluye la transformación geométrica, mientras que la segunda no.