• 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.

Separation plane calculation

Messages
374
Country
italy
Hi, this is the asm code for the first light of my calvert:

Code:
SEPARATION_PLANE PrimaFila, 21062, 0, -25101, 14524612
    BGL_LIGHT LIGHT_NAV, 0.008, 3.488, -886.512, 20, 0.60, 0.40, 0FFD4CE86h, 0.000000, 0.000000, 1.000000 ; source poly num = 1
PrimaFila label word

The runway heading is 320, so if I had right the vector components result are:

X: sin(320) x 32768 = -21062 (21062 used)
Y: cos(320) x 32768 = 25101 (-25101 used)
Distance: the distance from the gmax refpoint 0,0,0 are 443.256, so 443.256x32768 results in 14524612.

The problem is that my lights does not goes off when I pass over it and it is still visible from the opposite view. Are my calculation right?
 

Attachments

  • test.jpg
    test.jpg
    116.7 KB · Views: 400

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
31,843
Country
netherlands
Hi,

Why did you flip the plus and minus sign on the X and Y?

I think you need to make the distance negative in that case to get the correct side of the runway.
 
Messages
374
Country
italy
Thank you for the answer Arno. In fact I flipped the value because I followed the Wiki tutorial which says to take the X as negative value. By the way I'm going to test my code with the fixes.
As you may noticed from the attachment, my runway in GMAX is aligned with Y axis as I put the 320 rotation while exporting the models. In this case is correct to calculate the SIN and COS with 320? or should I use 0 as rotation?
 
Messages
753
Country
slovakia
You definitely need to use true heading in your calculations, irrespective of what you use in GMAX.

I think that the tutorial might have you flip your coordinates due to the different angle they took or they might have had the reference point on the other side of the lamps. The best way I can recommend is to try the direction vector by using a small displacement (like 32768) and seeing that the lights go out on the correct side of the reference point, then experiment with the vector size to get the right distance.
 
Messages
374
Country
italy
I will try to put one single light in GMAX at point 0,0,0 and see what will happens. So the final rotation that I put when I export my models (320°) should not affect the calculation, right? I have to calculate the SIN and COS with the true heading of my runway, 32/14 without taking care about the rotation put in export process.
 
Messages
753
Country
slovakia
Yes, the heading you put the model on in gmax or in placement tools should not matter. Putting a test light at 0,0,0 coordinates is a good way to test the vector direction.
 
Messages
374
Country
italy
Hi to all,
I've been able to solve my problem. First of all I tested the SEPARATION_PLANE with a light placed in 0,0,0 then I've extended the vector with the correct light position (in front of the runway). Basically my main problem was the calculation of X and Y component: I've used 32 as angle instead of 320 and... voilà! all works fine!
 
Top