Help rendering simple shapes

#1
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!
 
#2
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
 
#3
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!
 
#5
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?
 
#6
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.
 
#7
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.
 
Top