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

Polygon manual vector attributes

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,501
Country
netherlands
Hi,

I have got another problem with reading in SCASM commands for my ModelConverterX tool. In some macros the normal of the polygon (Poly, TexPoly, etc) is defined manually with the "m" argument. That is easy, because then I could just copy it. But these normals also have a length argument. That does not really make sense to me and it seems that the polygon behaves differently if the length is negative. Does anymore remember how this worked? I tried to find some documentation on this, but it is hard to find :).
 
Hello Arno,

All polygons drawing commands had 4 numbers at the start followed by a list of points. The 4 numbers define a plane in the 3D space. VX VY and VZ define a vector or a direction (which is not sufficient to define the plane). The plane is perpendicular to that vector and its distance to the RefPoint is the LEN parameter. So the 4th parameter fixes the plane.

This plane divides the 3D world in 2 1/2 spaces (inner and outer half spaces). For positive LEN the inner 1/2 space is the one that contains the RefPoint.

If the viewpoint is in the outer 1/2 space the polygon is taken (drawn). Otherwise it is skipped.

Negative (!) LEN switchs the meaning of inner and outer.

Scasm had an alternative A parameter. This A replaces the 4 described parameters. The 4 numbers were evaluated from the first 3 points in the list. AI was another alternative whre the LEN taken from the first 3 points was made negative. This was used to draw inside walls, for example.

Hope this is correct and useful.

Kind Regards,

Luis
 
Thanks Luis, I think I fixed it by now. As the vertices of the polygon already define the plane, using only the direction of the normal seemed to work in the end for me. I had some other bugs in my API parser that caused this problems.

The a and ai arguments were a lot easier to implement actually :).
 
Back
Top