First of all, you may find out that you should wrap a AltertanativeContent
in OOXML, it contains 2 parts, Choice for rendering 3D Model, and Fallback as an image demonstrator of the Model.
Second of all you can fill the Fallback elements easily by wrapping OOXML elements. But for the Choice element, you should create an OpenXMLUnknowElement
and fill it with the OpenXMLAttributes
.
For example you should have an OpenXMLUnknowElement
for Camera, Lights, Translation Objects and so on...
I've found out some heuristics which helps me to cope with the solution, While it's not a complete solution but it's a good way to go.
- The Lights in all 3D scenes in PowerPoint have same values so you can use them exactly from a simple file:)
- You can use default Camera, or calculate the distance of Camera using this answer.
- For meterPerModelUnit scaling factor, After reading and parsing your 3D Model using some available packages, such as Microsoft GLTF or Khronos gltf Loader , you can calculate it easily using this & this.
The formula is 1 / (2 * MaxExtentsOnXYZ) or 1 / MaxExtentsOnXYZ.
- It's a hard task to generate the Fallback image and if you use some arbitrary images the user should click on it to reload the scene. Consider that there may be a feature release in the future for this issue, But I've found that by Feeding the part using an Image with lower dimension of the Extents of the shape box, PowerPoint will automatically bring you the 3D rendered Model, I don't know whether it's a bug or an intended feature.
- Another way to automatically go to the 3D rendered scene is using Skinned Skeletal Animations. I can't figure out a simple method to do it, But I think it's a feasible solution. Remember that as Microsoft 3D Models Guideline stated, other types of animation (Rotations, ...) are not supported in current version of PowerPoint.
- I also couldn't figure out how to calculate the PreTrans, as it's essential to have a center-oriented object.
For your second questions, I think GLB is the standard way of transporting 3D Model files. Also as Todd Main suggested to me, you can ask directly from Microsoft Open Specs Q&A