3D animation in Enterprise Dynamics

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

3D animation in Enterprise Dynamics

Post by HarryBunnik »

During the last few years a lot of questions regarding 3D animations using 3D models within Enterprise Dynamics (ED) have passed my desk. Some are really hard to solve, some needing only a very small trick to get things working. Within this thread I hope to share some of this knowledge and answer questions that haven’t made my desk yet. So please feel free to ask additional questions when something is not clear or not working the way you want.

The Basics

Before loading a 3D model in ED, we have to make sure the 3D model is up to the job and is suitable for its goal. So let’s first follow the small check list below, to ensure that what we have in mind is possible.
  • - Required version of Enterprise Dynamics

    To be able to add your own 3D models in ED, it is necessary that you have an Enterprise Dynamics Developer, because we need to do some things in the Atom editor, which is not accessible in lighter versions of ED.

    - ED accepted files

    ED accepts Studio 3D max (.3ds) and vrml (.wrl) objects. Two of the most used standards around for 3D models. Please note that .dxf files are mostly used as a background upon which the simulation model is based and can also be made visible in a 3D animation.

    - What is the size of the 3D object.

    When the object is drawn using millimeters as major size, it can happen that in ED this will show as meters. So instead of your nice model, you see a lot of empty air…

    - Placing of the 3D model

    For ED it’s preferred that the object is placed in the right upper quadrant (Because atoms are also drawn in the right upper quadrant. This will ensure that the translation of your model will be as limited as possible. )

    - Location relative to the origin

    Make sure that the object is near the origin. I once had the question why the model didn’t show up in ED, finding out that it was shown… 1.5 km to the right and 6 km up…

    - How complicated is the model.

    I know that realism is great and important, but keep in mind that when we want to have a factory with several thousand of expensive cars being produced, a very high polygon 3D model of the beautiful car, will cause the simulation to get sluggish. And a sluggish animation will not impress! Despite the wonderful 3D models…
    So try to keep your poly count low and use textures or UV mapping to achieve the level of detail wanted.

    - Text in 3D animations

    ED has unfortunately the behaviour to mirror the 3D object loaded. So when you have a nice text placed on your model, remember to mirror your object, place it in the right scaling in the right upper quadrant and you’ll see that in the simulations animation the objects text will be perfectly readable.
More information will follow in the future.
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: 3D animation in Enterprise Dynamics

Post by HarryBunnik »

Loading the model in ED

Now we handled the basics, I give some guidelines and handles how to load 3D models in you simulation model, or how to link them to your atom.

Do note that to make advanced 3D animations you need to have ED developer.
  • - Load 3D model in ED

    To load the model in ED, you have to place the object in for instance the:
    Enterprise Dynamics 8 Developer\media\3Dmodels\your directory\your model.wrml. Placing your own models within the Enterprise Dynamics directory, makes the model less vulnerable for dead links (error at "AddModel3D":File C:\... \YourModel.wrl ) always occurring when you want to show your new, nice simulation to a customer and placed it their computer.

    - Replace 3D model in ED

    Once you loaded a 3D model, made some improvements and want to replace it with this newer version, you have to remember that first all links from instances to the 3D model must be broken. Otherwise the object is still in use somewhere in your model and can’t be deleted. So in some cases it’s easier to restart ED, after replacing the old 3D model with the new one.

    - 3D models look dark

    Sometimes it may look like the 3D model in ED is quite dark. In that case you have to add an “omni light.atm” to the model. This will act as a light source and therefore brighten the scene.

    Another option to increase the intensity of the colours of the 3D model must be done in the 3D modelling program of your choice by adding some ambient colour to the model, thereby improving its appearance in ED.
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: 3D animation in Enterprise Dynamics

Post by HarryBunnik »

Modelling in 3D
From ED 8.2 on, the possibilities to model in 3D are further enhanced. In this part of the thread some attention will be given to new possibilities.
  • - 3D grid

    New is the option to have a 3D grid in ED. (Preferences\3D\show grid
    This grid is placed on Z=0, has a limited reach and moves with the camera. This to prevent a grid on the entire x-y

    - Selecting an object

    When selecting an object within 3D the cross, introduced in version 8.0, is in version 8.2 replaced by a selection box positioned at the bottom of the selected object.

    Note that this box will be drawn around the basis of the atom. When the 3D object is not drawn at the same position as the atom is positioned, than the selection box can appear to be misplaced.

    - Advanced atom positioning in 3D

    Since version 8.0 of ED it was possible to move object within 3D (F12 shows a 3D position menu), but with 8.2 the controls have been made more intuitive by allowing the positioning of the atoms using the mouse.
    • Select an object, press the Ctrl button and keep it down and use the mouse to position your object in the X and Y plane.
    • To move you object in the Z-direction press Ctrl + Shift and move the mouse.
Have fun modelling in 3D!
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: 3D animation in Enterprise Dynamics

Post by HarryBunnik »

Animating the model

To show a model in Enterprise Dynamics, the check box 3D model on the 3D tab in the Atom Editor can be checked. As long as your object is static, this would be enough.
However, how much nicer wouldn’t it be when your machine is mimicking the movements of the real machine. That would make the simulation more interesting and recognizable for everyone.
Because of the wide range of machinery, it’s not possible to explain all within this thread, but a lot of movements can be mimicked without too much effort. After all, when you want your machine to simulate correctly, a lot of cycle times that are defining the machines movements are already there. We only have to use them.
  • - The start of animation

    Define which part(s) of your model are actually moving. With most machinery, a lot is static frame. So we start with placing all static parts in one layer of our 3D model and then combining all moving parts into separate layers, where each layer consists out of parts that are involved in the same movement. This makes it possible to move only that what needs to be moved and to leave all other layers where they are.

    - Advanced 3D animation

    To make a nice animation, we have to write some code. To be allowed to do this, we have to set the tab 3D to 3D Draw, instead of 3D model.

    - Layers/Meshes and their order

    Within ED it is possible to draw the different meshes/layers assigned earlier within the 3D model separately. However the order with ED will not always be the same as within the 3D drawing program. So check the order, before you start animating. (Use meshcount(model3d(c)) to get the amount of meshes within your model and use DrawModel3DMesh(Model3D(c), count, … to draw the preferred mesh.)

    - Use an indicator to determine what the machine is doing

    What I normally do to make a moving animation, is setting a label or attribute on the atom indicating in which status the machine is and at which time he started with that action. Normally you know how long that action will take as well. Using a case statement in the On3Ddraw will define which part we want to move. Using the Label([StartTime]), the current time and the cycle time tells us exactly at which point of its cycle, the moving parts are. Changing the status will get us to the next case statement with a new action and so on. Of course this can be made as complicates as you want.

    - Errors… Heaps of errors…

    Of course, when testing your 3D animation there will be a moment that there is an error in your code. Because the On3Ddraw is executed around 24 times a second, this error message will show up a lot of times… To stop this, simply close the 3D animation screen. This will stop the execution of your code, giving you the chance to fix it.

    - Updating the appearance of your 3D model

    Changing color of a 3D model mesh within ED. It is possible to manipulate the color of a mesh or a complete 3D model using ED. This can be very useful when you want use in 3D a color coding for the products, where each color gives an indication about the status of your product. To achieve this you have to do the following:

    Code: Select all

        SetMaterialColor(ColorOfYourChoice, DIFFUSE_AND_AMBIENT_COLOR),
        SetMaterialOverride(True),
        Drawmodel3D(model3D(2, c), 0, 0, 0, xSize(c), ySize(c), zSize(c)),
        SetMaterialOverride(False),

    This will result in an object which is colored in the “color of your choice”. By setting the material override to false again allows you to continue drawing other objects that have their native color. This can also be applied to just a single mesh out of the 3D model.
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: 3D animation in Enterprise Dynamics

Post by HarryBunnik »

After you've made such nice 3D animations, you might want to make nice movies of it as well. Of course there is already functionality in ED to record movies, but sometimes you want just a bit more options. For that reason I've created a new MovieCreator atom. The atom itself is stable, but need some additional testing. So for who is interested, a Beta release of this atom can be found here:

a-movie-creator-t212.html

Have fun,

Harry
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: 3D animation in Enterprise Dynamics

Post by HarryBunnik »

With the introduction of ED 9, new functionality became available for those that don't want to create complicated 3D animations, but do want to simply replace an existing 3D model of, for instance a server or product, with their own machines or products. To give this functionality a bit more fame, I also point to it here.

It can be found under Tools => Alter 3D:
Ribbon ED.png
Ribbon ED.png (30.17 KiB) Viewed 6975 times
This button allows you to select an object in the model and then to change it's appearance by selecting your own 3D object.

A more comprehensive explanation can be found in the ED help.

Cheers,

Harry
Post Reply