Comments on: X-Plane 11 Instanced Drawing Sample https:/code-sample/instanced-drawing-sample/ Developer resources for the X-Plane flight simulator Sun, 28 May 2023 19:46:01 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Capt. BLB https:/code-sample/instanced-drawing-sample/#comment-42333 Sun, 28 May 2023 19:46:01 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-42333 In reply to Thorsten R..

I had the same result. After some debugging (and a little dumb luck) I figured out that the better pushback plugin messes with the default tug object. So if you have that plugin installed you can move it out of the plugins directory and try again. Alternatively, you can load a different object by changing the virtual path assigned to g_objPath. For example, to load the fuel truck instead, you can change the value to “lib/airport/vehicles/fuel/hyd_disp_truck.obj.”

TIP: To find virtual paths to other default objects you can load, take a look at “Resources/default scenery/sim objects/library.txt

Hope this helps!

]]>
By: Tigerbeard https:/code-sample/instanced-drawing-sample/#comment-40064 Fri, 28 May 2021 17:54:47 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-40064 The sample runs fine in my X-Plane V11.53 and I see the tug appearing on the aircraft position after selecting the menu option to add an instance.

However, configuring a second PC with the same Version on it as External Channel (the master runs the test Plugin) with the same viewport settings I can observe
* The Tug object is only added on the Master, but nothing appears on the External Channel.
* The View direction and position syncs fine.
* The tug model is visible in the airport traffic on both PCs, so the model file is available.

I wonder why is the Instance Loaded Object is not synchronised to the external channel. Is that a bug or is there anything else I need to so in the plugin or in the setup?

Tried on Windows7, x64 an Ubuntu18.04,x64

]]>
By: Thorsten R. https:/code-sample/instanced-drawing-sample/#comment-39473 Sat, 23 Jan 2021 15:41:13 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-39473 I’ve compiled the plugin, and the execution in the simulator 11.51r1 has been verified using the debugger. When I click the menu option to add an instance, the code is executed but I see nothing in the simulator, neither in OpenGL nor in Vulkan.
I would be expecting to see the tug spawn at the position of my aircraft, and at least just sit there, but nothing is visible at all.

]]>
By: John Doe https:/code-sample/instanced-drawing-sample/#comment-39463 Fri, 22 Jan 2021 15:01:09 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-39463 This code compiles, and produces a folder named X-Plane-11-Instanced-Drawing-Sample which contains the actual win.xpl, and this folder is copied to x-plane resources plugins. The menu entry instancing sample is present in the plugins menu, as is the option to add an instance.

My aircraft is spawned at whatever airport, and I have pressed shift + 4 for external view.
What exactly should I be seeing there, except for my own aircraft ?
The reason I ask is: There is *nothing* at all to be seen at my aircraft position, except for my aircraft.

If I understand the code, the tub.obj should be spawing at exactly my aircraft position for which the according datarefs have been queried and saved stored, then the XPLMDrawInfo_t (struct resembling type) is fed with the data from the stored datarefs, and passed to XPLMInstanceSetPosition along with the tug object reference that is pointing to a supposedly loaded tub.obj.

Using X-Plane 11.51r1 and a response would be greatly appreciated.

]]>
By: Young https:/code-sample/instanced-drawing-sample/#comment-38837 Thu, 10 Sep 2020 20:46:58 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-38837 Hi, is there any drawing example? This example doesn’t really draw instances. I’d like to see some example how to use draw callback for instances (or objects).
Thanks!

]]>
By: Bobbie E. Ray https:/code-sample/instanced-drawing-sample/#comment-33939 Mon, 29 Jul 2019 07:17:32 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-33939 In reply to Ben Supnik.

Hi – I’ve noticed the same behavior. If you provide NULL for the float value, XP crashes. However, providing a NULL for the data ref pointer seems to work just fine.

Cheers.

]]>
By: Bobbie E. Ray https:/code-sample/instanced-drawing-sample/#comment-33932 Sat, 27 Jul 2019 22:50:43 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-33932 Hi – thanks for providing an example and I got it to work. However, is there any way to influence the pivot point of an OBJ? Instead of a tug I’ve drawn an aircraft and when I change the heading, or pitch the object is not turning/pitching at the center of gravity, but rather at the nose of the plane.

Thanks!

]]>
By: Ben Supnik https:/code-sample/instanced-drawing-sample/#comment-33244 Sun, 24 Feb 2019 21:23:06 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-33244 In reply to Peter Bond.

No interpolation – you don’t provide a velocity. Push new data per frame!

]]>
By: Peter Bond https:/code-sample/instanced-drawing-sample/#comment-33240 Sun, 24 Feb 2019 16:11:05 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-33240 Just a general question about the Instance API. Will object movement interpolation take place automatically by X-Plane (e.g I only provide starting position and velocity and X-Pplane does the rest) or do I have to calculate and update the actual positions and set them via DataRefs?

]]>
By: mapleberry https:/code-sample/instanced-drawing-sample/#comment-32282 Sun, 28 Oct 2018 09:21:35 +0000 http://developer.x-plane.com/?post_type=code-sample&p=7834#comment-32282 sim/graphics/animation/ground_traffic/tire_steer_deg to sim/graphics/animation/ground_traffic/mycustom_ref_deg for example, at both place: in your code and in my custom object animation, but nothing works... I also tried to declare my custom dataref using XPLMRegisterDataAccessor(), but without success... where I'm wrong ? Could you give me/us small piece of code as example to declare and use custom datarefs, please ? Thanks]]> Hi,
Thank you for this example, it works with my custom object designed in Blender, but what about custom datarefs ?
I’m trying to change from your’s
sim/graphics/animation/ground_traffic/tire_steer_deg
to
sim/graphics/animation/ground_traffic/mycustom_ref_deg
for example, at both place: in your code and in my custom object animation, but nothing works…
I also tried to declare my custom dataref using XPLMRegisterDataAccessor(), but without success… where I’m wrong ?

Could you give me/us small piece of code as example to declare and use custom datarefs, please ?

Thanks

]]>