Did You Know? Discover Key Frame Animation in PDF3D
The PDF3D products do a great deal more than most people realise. In this ‘Did you know?’ series, we’ll be going through each of the features you may not know exist within your 3D PDF tool.
This article is all about the key frame animation feature in PDF3D ReportGen. What makes this a great feature in both our end-user and developer products is that our animation is on U3D. and PRC coding types. You can find out more about why PRC is a superior 3D format in this article: PRC Benefits Over U3D.
As an example of a recent project undertaken by a user of PDF3D, you can see PDF key frame animation in action in the 3D animated robot arm with complicated multiple 3D parts moving smoothly throughout the animation within the PDF. The animation shows how each of the robot parts moves in relation to each other to demonstrate how the robot will behave when built. It can be viewed from different angles with different rotations, orientations and positions.
Discover this neat little trick in PDF3D ReportGen…
Whilst our PDF3D SDK product has had the functionality for many years, the key frame animation is a relatively new feature for the end user. This means that currently PDF3D ReportGen doesn’t have an obvious menu option to create animation but it is easily possible within the software. Here’s the know-how on this neat little trick within the product…
Firstly, the model’s parts need to be structured in hierarchal order and frames (individual images) need to be set up as you would in video production. The sequence of these key frames will define what the viewer sees when finished. The easiest way to start is by describing the animation moves in XML format.
- Create a simple file conversion setup without animation and save the settings out to an external XML file by clicking the “export state” button.
- Add the animation key frames by introducing movement tags.
- Open up PDF3D ReportGen, click the ‘import state’ button and reload settings and convert.
It’s that straightforward. Each key describes where some object should be moved, scaled or rotated at a given timing mark.
Anyone with basic XML skills can edit the data needed to set the key frames. You will need to set up groups and assign each part with a time delay along with the rotations and positions required. You will find example code within the software that you can edit if you find that easier to begin with.
As you can see in this example, the only difference between the key frames is the differing angles for a particular 3D part:
<NodeMovement nodeName="RobotArmGroup3" localRepeatMode="PingPong"> <KeyFrame> <Position x="0" y="0" z="0"/> <Rotation x="0" y="0" z="1" angle="0" /> <RotationCenter x="0.0" y="0.0" z="0.0" /> <Delay value="2.5"/> </KeyFrame> <KeyFrame> <Position x="0" y="0" z="0"/> <Rotation x="0" y="0" z="1" angle="40.0" /> <RotationCenter x="0.0" y="0.0" z="0.0" /> <Delay value="2.5"/> </KeyFrame> <KeyFrame> <Position x="0" y="0" z="0"/> <Rotation x="0" y="0" z="1" angle="80.0" /> <RotationCenter x="0.0" y="0.0" z="0.0" /> <Delay value="2.5"/> </KeyFrame> </NodeMovement>
More information on key frame animation is included in our full manual but if you require additional help, we’re happy to go through it with you on screen to help you get started. It only takes a few minutes. Just contact the PDF3D team to find out more. Look out for more hidden tricks in our next ‘How to…’ or get in touch if there’s anything you’d like to know specifically.