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

Help rendering simple shapes

Messages
11
Country
us-texas
Hi,
I'm being asked to quickly add the capability to draw shapes/rings into the simulation. I would receive an external command, and I would draw/erase shapes at specified locations. I'm searching for the best way to do this and I'm not finding any help (I may be looking in the wrong places). I am using P3d V4.2.

I have an external SimConnect client in C++, and I can find commands to draw text using SimConnect, but I don't see a way to draw shapes. Is it possible to render/draw simple shapes using an external SimConnect client? If so can someone point me in the right direction? And, if not can you still point me in the right direction. My experience is limited to retrieving data from the user AC, and controlling aspects of the user AC via controls.

I have found the P3D SDK Rendering link, including methods such as DrawCylinder, but I cannot find any examples on how to use them. I suspect they are not available externally, but I'm not sure.

Any help would be greatly appreciated!
 
I believe you are mixing up the PDK with the SDK/Simconnect. DrawCylinder is part of the PDK and is different from the SDK/Simconnect environment. I have only played with the examples in the PDK. You are into C++ dll's only and COM.

see

PDK light sample
 
I really appreciate the sample, thank you! I will be playing with it shortly.

If I understand you correctly, I would have to create a .dll which is loaded when P3D loads, and I would have to establish an interface (via Simconnect client area) to send commands to the .dll, which would then render the shapes.

Am I understanding correctly?

One thing I did not mention is that there is already a .dll (loaded via dll.xml) to access custom variables. I do not have the source code for that .dll. Can I run multiple .dll? And is it wise?

Thanks again!
 
Just about every user out there has multiple dlls in the dll.xml.
 
Thank you - that helps a lot. I have a great fear of "breaking" P3D.

Can I assume that my understanding of the path to follow (shown in previous post) is correct?
 
Do the shapes/rings you want to display need to be dynamic in their appearance (e.g. size, color)? If not, you could also just inject SimObject models using the SimConnect_AICreateSimulatedObject API call.
You'd need to create the (static) objects using one of the modelling tools and place them in a SimObject container.

If you need simple shapes with dynamic properties, then the new PDK drawing functions are indeed a good solution. However, a separate dll is needed which makes things a little bit more complex.
 
Thank You! They will be static, so this might be a great option, and I would never have thought of using AI objects.

I'm really glad of the explanation because some day we may need dynamic behavior.

Thanks to the three of you - you have greatly shortened my learning curve.
 
Back
Top