Where does the light come from?

A while ago I changed the way the lighting works in the ModelConverterX preview. Before the light would always come from the view point, while now there is a separate light location. The downside of this change is that you now can see that some sides of the model are always darker.

I have been thinking about adding a nice time of day simulation where the sun moves around your object, but in the end I decided that is probably not so useful. Instead I have now added two sliders where you can manually alter the direction where the light comes from. The azimuth slider controls the direction it comes from and the elevation slider determines the height of the light compared to ground level.

You need to click on the button with the three yellow arrows you show or hide the toolbar where the sliders are location.

I hope this feature makes it even easier to inspect your model in the right conditions.

Image2013-04-15 2123.12.022

Flattens from 3D objects

Last week I got approached by different developers with suggestions for ModelConverterX to create flattens. So given multiple questions about the same subject I was trigged to look into this issue. Since I mainly create scenery for the Netherlands I have never had trouble with flattens myself. I think in the Netherlands you would even get away without any flattens, since the terrain is already flat.

But in more hilly or mountainous areas the problem is that FSX airports have to be flat, so a flatten is created for the airport. But if the terrain around the airport has quite some elevation differences, you are likely to end up with your airport on a plateau or other undesirable results.

By creating a sloped flatten you can usually make a more gradual transition from the airport to the surrounding terrain. Tools like SBuilderX and ADE allow you to create such flattens. But finding the correct elevation for the points can be tricky.

With this new functionality that will be available in the next development release another way to create sloped flattens is possible. You can now model the terrain shape in your favourite 3D modelling tool and convert it to a flatten with ModelConverterX. What this functionality does is create a sloped flatten for each polygon in the model.

Simply model the shape you want and export it to a MDL file. Then you import the MDL into ModelConverterX and enter the coordinates of the reference point. Next under export scenery you will find the new format “FSX flatten BGL file” and this will use shp2vec to create the flatten BGL from your object. Below is a picture where I turned one of my test objects into a flatten (I know, this is not a useful terrain shape, but it demonstrates the concept).

I am not sure yet how easy it will be to model a shape in your 3D modelling tool and still get a nice transition to the surrounding terrain. To do that well I guess you need to be aware of the terrain shape in your modelling tool. I would be happy to hear any feedback from developers that try this new approach on how that works and which improvements could be made there.

Image2013-04-14 2221.55.890

 

Import AGN files

Until now the scenProc tool could only be used to create AGN files. But when you want to enhance or view existing AGN files it is also useful to be able to import them again. That feature has been added to the development release versio now. To illustrate how it works I will explain two use cases where this new step is used.

Enhance existing AGN files

Let’s assyme you have made some autogen files before only containing forest polygons. You used a file like this to create this autogen:

IMPORTOSM|schier.osm|*|*
#
SPLITGRID|AGN
#
CREATEAGNPOLYVEG|FTYPE=POLYGON;landuse=forest|{e8b937fd-a1f2-4bd5-8548-2c80d30102af}
#
WRITEAGNFILES|FSX|c:\flightsim\fsx\myscenery\texture

And now you want to add autogen buildings to the same area as well. Of course you could run the entire process again, adding more rules. But now you could also import the existing autogen and add only the new buildings. This is a configuration file that would do that:

IMPORTOSM|schier.osm|*|*
#
IMPORTAGN|c:\flightsim\fsx\myscenery\texture
#
SETAGNBUILDINGHEIGHT|*|1.0;0.0;0.0;0.0
#
SPLITGRID|AGN|building=*
#
CREATEAGNGENBUILD|FTYPE=POLYGON;building=*;FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CREATEAGNGENBUILD|FTYPE=POLYGON;building=*;FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
#
WRITEAGNFILES|FSX|c:\flightsim\fsx\myscenery\texture

What happens here is that after loading the source data, you also load the existing AGN files. This means that all autogen defined in there is added to your data cells and when you create additional autogen it will be added to what is already there. So when you export it agian you have the old and the new autogen.

Export AGN files

How scenProc normally works is that you load vector data, this is then stored as internal vector features. Using the different steps you then create autogen objects out of these. In the example above the autogen objects were imported again, but in that case they are not converted to features, they stay as autogen. If you want to export the AGN to shapefiles for example, you would have to convert them back to features. This configuration shows how that can be done:

IMPORTAGN|c:\flightsim\fsx\myscenery\texture|CREATEFEATURES
#
MERGEGRID
#
EXPORTSHP|*|my_agn

The additional CREATEFEATURES option tell the tool to make features again. And these can then be export to SHP. The MERGEGRID step is optional, but what it does is the reverse of the SPLITGRID step, it combines all different cells into one big cell. This means you get one SHP file for the autogen, else you would get a SHP file per tile

Choosing shaders

A new option has been added to ModelConverterX, with this option you can force the preview to use simple shaders. This option has been added because certain graphics cards have performance issues with the more complex shaders that are used by default. By setting the ForceSimpleShader to true the preview is forced to use the simple ones (you need to restart to see the effect).

What does simple shaders mean? It means that the preview will not show the more advanced features like night textures, bump textures or specular textures. Only the diffuse colour and texture will be shown. But that should be enough to view your object at a better performance.

The animation editor became a real editor now

From the next development release the animation editor will have an additional feature, you will now be able to adjust the type of each of the animations. So in a way you can now really edit the animations (as the name of the editor already suggested of course).

Just select the animation you want to change and then select the new animation type you want to use in the combobox. After that you press the button to assign the new animation type. That’s all!

Btw, there was also a bug in the development release of yesterday concerning animations. Due to this bug the animation name was not read correctly for certain animations. This bug has been fixed by now as well.

Animation editor

Animation editor

Improvements for aircraft models

In the next ModelConverterX development release there are two big changes that are mainly important for aircraft modellers:

When a custom animation is used in the FSX MDL file that is not defined in the modeldef.xml file that you pointed ModelConverterX to it will no longer be ignored. Instead ModelConverterX will read the animation parameters from the MDL file and add the right XML code to the modeldef.xml file. It does this all in memory so the modeldef.xml file on your disk is not altered by the tool.

Mouse rectangles and now read from and written to FSX MDL files as well. Just as for the custom animations ModelConverterX will first try to find the mouse rectangle definition in the modeldef.xml file and if it does not find the right one, new XML code is added in memory.

In the Hierarchy viewer you see with mouse rectangle is assigned to which part, just as you can see the visibility conditions.

I tried to test these new features as good as possible, but I am no aircraft designer myself. So I am sure you might come across some animation or mouse rectangle that does not work exactly as expected. In that case please let me know.

One other issue you might come across while examining your VC for mouse rectangles  is that the ModelConverterX preview becomes slow if you load a complex VC model. For the FSX default models it still works fine, but the much more detailed VC models that come with many of payware aircraft will bring the preview down to a slide show. I am investigation where the performance bottleneck is and hope to fix this in an update soon.

Moving around in the preview

p11sTo move around in the ModelConverterX object preview you would use your mouse. With the left button you can rotate the object, with the right button you can pan the object. And with the mouse wheel you can zoom.

And to control how much zoom and pan you give there are two options: PanScale and ZoomScale. These can be changed to determine how much pan and zoom effect moving your mouse gives.

A while ago I also added a sensitive mode. This means that if you keep the S key pressed all rotating, panning and zooming will go with steps that are 10 times smaller than normal.

And from the next development release there is another way to move around in the preview. You can now use the keys on your keyboard as well. With the arrow keys you can move around over the ground plane. With the up key you go forward, with the down key backwards. Left and right obviously move you in those directions. And the page up and page down keys can be used to move up and down respectively.

Hopefully this new navigation mode makes it even easier to move around and inspect your models.

Back online

offlineIt must have been Murphy’s law, just a day after I left home the server on which this website runs went offline. And remote I could not login anymore to correct the problem. So this site has been offline for a couple of days now.

Today I got back home again and after a quick reboot of the server everything seems to be running fine again. Just let me know if you still have any and sorry for the inconvenience.