• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Calculation Tool for placing objects?

Messages
453
Country
austria
Hi folks,

Yesterday I tried ObjPlacer XML the first time and I am really delighted. This tool is perfect!!! It really is a tool that makes designing a lot more comfortable.

But aside from this I have a question: Is there any Calculation Tool or even a formula to calculate the accurate position of a reference in fs9 out of the coordinates in GMAX?

I am asking because I currently have one problem: On top of a terminal building there should be placed a flagpole with an animated flag. To make sure that the animation works I think it is crucial that the 0/0 coordinate of the flag perfectly is aligned to the center of the flagpole (in this case). As the whole object (the terminal building) is centered at a reference point which certainly does not fit to the one of the flagpole I am wondering whether it is possible to calculate the fs9-coordinates out of the GMAX-position.

:yikes:

OK perhaps this sounds confusing. But I have to admit that I am already confused with that issue. Does anybody know how to proceed?

gianni
 
Hi Gianni,
The simplest way to do what you want is to export flagpole as separate object centered at 0; 0 coordinates in GMax. So you'll have 3 objects: building, flagpole and flag. Next place your building wherever you wish. Then place flagpole on/near the building. When you are satisfied with flagpole position, use same lon/lat coordinates for flag itself taking in account flagpole height.

Alternatively you can use BiasXYZ statement, but then you'll need to make some trigonometric calculations because biased objects do not inherit heading rotation defined in Scenery Object statement. If you like I can explain the necessary calculations. You can also find them yourself (just look for circle parametric equation).However, FS parameters have finite precision, so you may end up with somewhat misaligned flag which is more noticeable than misaligned flagpole.

I think the first method is much easier and more precise. There should be no difference in frame rate as well.
 
Hi Stranger,

many thx for your reply. I will use the first way, because mathematics is not really mine ;)

But if you have time it would be nice to learn more about the indicated "circle parametric equation" (oh my God!) :eek:

gianni
 
Hi Gianni,
Here is a math method you asked for.

1. Find world XY coordinates of flagpole in GMax. That is the distance from the scene world center (0;0) to the center of flagpole. (See Fig.1) To find out a sign consider Up & Right are +; Down & Left are -. You can get precise coordinates by choosing move tool and looking at the bottom of GMax window (Fig.2) while flagpole is selected. Make sure that world coordinates are selected (Marked by red circle on Fig.2).

2. Make following calculations:
X1 = X * cos(Alpha) + Y * sin(Alpha)
Y1= -X * sin(Alpha) + Y * cos(Alpha)
where X1 and Y1 are new offsets after rotation; X and Y are coordinates you’ve found in previous step; Alpha is true heading in degrees of your model in FS.

Let’s see an example:

We have a terminal with flagpole nearby as shown on Fig.1. The distance between flagpole and terminal reference point (0; 0) is X=-30m and Y=-20m. The terminal is placed in FS using heading of 60 degrees as follows:

<SceneryObject lat="Naa aa.aaaa" lon="Ebb bb.bbbb" alt="0" pitch="0" bank="0" heading="60" altitudeIsAgl="TRUE" imageComplexity="NORMAL">
<LibraryObject name="nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" scale="1.0"/>
</SceneryObject>

Now let’s make calculations:
Sin 60* = 0.86602540378443864676372317075294
Cos 60* = 0.5

X1 = -30 * 0.5 + -20 * 0.86602540378443864676372317075294 =
= -15 + -17.320508075688772935274463415059 =
= -32.320508075688772935274463415059m

Y1 = --30 * 0.86602540378443864676372317075294 + -20 * 0.5 =
= 25.980762113533159402911695122588 + -10 =
= 15.980762113533159402911695122588m

0.1mm precision should satisfy us so we round the numbers to 4 decimals:
X1 = -32.3205m; Y1 = 15.9808m

Now we are ready to place our flag. Add following to your XML:

<SceneryObject lat="Naa aa.aaaa" lon="Ebb bb.bbbb" alt="0" pitch="0" bank="0" heading="0" altitudeIsAgl="TRUE" imageComplexity="NORMAL">
<BiasXYZ biasX="-32.3205" biasY="0.00" biasZ="15.9808"/>
<LibraryObject name="mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm" scale="1.0"/>
</SceneryObject>

where lat and lon parameters are same as those of terminal. The altitude of flag can be defined by use of alt or biasY parameters.
 

Attachments

  • Coordinates.jpg
    Coordinates.jpg
    8.2 KB · Views: 579
  • PolePos.jpg
    PolePos.jpg
    18.5 KB · Views: 600
Last edited:
Hi Gianni,

Yesterday I've got almost similar problem solved. I had to place anti-collision lights around power plant stacks. After second manual calculation I desided to hire my computer for this job.

I've made a simple bias calculator that do calculations mentioned above automaticaly. You only need to supply X,Y distances and rotation angle. Result is given as values and as formated BiasXYZ statement wich can be pasted in your XML code directly.

If you are interested I can send it to you by e-mail. Size in zip is 211k.
 
Hi Stranger,

yes I would appreciate your tool. could you please send it via email? (johannes.kimla@aon.at)

thx in advance!
:wave:
gianni
 
Hi Gianni,

here two different approaches on how to place for example your flag exactly on a position of a different object in a scenery without any calculation.

1: Assumed you have a building developed in GMAX. Now you place the building via XML to a position LAT:X LON:Y . Let's assume also, you have your flag as well developed in GMAX under the a name FLAG.

2.:Now, to place your flag onto a position of your choice at the building you open with GMAX the building object, next selecting the MERGE function and open your flag file.
You can now move with the mouse exactly your flag on a position of your building you want.

3: Do a export of the building with the flag included ant place your new building with the flag again on your X/Y position in the scenery. Thats it.

If you just have the building via a tool placed in the scenery you can use the CHPLUS.zip
tool ( available at AVSIM) to find excactly the LAT/LON position, the HDG and the altitude in order to place your flag onto your building. It is very precise also.

It is just a different way of doing the same thing.

Best
Dietmar
 
Back
Top