Jump to content

SchneiH2

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by SchneiH2

  1. Hi everybody Basically, there are two parts of the question: First is that I am trying to translate Ben's Gizmo64 code for the terrian map into a SDK plugin, however so far without success. My below code basically works, however, does not display a terrain texture. I am wondering, how to get the texture id of the terrian, if there is any. int efb_map_draw( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon) { XPLMBindTexture2d(map_texture, 1); XPLMSetGraphicsState(0, 1, 0, 1, 1, 0, 0); glColor3f(0.75, 0.75, 0.75); glTranslated(64, 15, 0); glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0, 1); glVertex3f(0, 50, 0); glTexCoord2f(0, 0); glVertex3f(0, 230, 0); glTexCoord2f(1, 0); glVertex3f(240, 230, 0); glTexCoord2f(1, 1); glVertex3f(240, 50, 0); glEnd(); glPopMatrix(); return 1; } Secondly, I am wondering whether there is a possibility to display the map from the map UI (i.e. aso differnt layers like VFR, IFR low/high) on an instrument/gauge. At least the G1000 gauge has this option. Having looked through the new map api I could not find any routine to get a texture id of the map. The map sample code on the SDK page creates to my understanding new layers in the map UI bu I do not see there any solution to display the map on an instrument on the 3d panel. Thank you up front for possible help. Best regards SHJ
  2. Just to close this topic: Problem solved thanks to Ben's hint to use drawing phase xplm_Phase_Gauges. I just did not use the rght coordinates initially to display the string on the 3d panel. Thansk again for all replies and help. SHJ
  3. Hi Jim Thanks for your reply. If I understand correctly than Gizmo64 acts as a kind of overlay to the SDK and uses the SDK code set/API? Using xplm_Phase_Gauges works in a way that it indeed draws the string on the 2D panel. Regarding the Gizmo64 code shown above I am a bit puzzled that to my understanding with glPushMatrix() and glPopMatrix() OpenGL is being addressed. However, adding this to the plugin code does not give any effect. Could there be a necessity to somehow 'load' the 3D panel png in the plugin code? Frankly speaking I do not fully understand the meaning of the second part of below explanantion from the SDK Thanks up front for additional comments Best regards SHJ
  4. Hi guys Many thanks to all of you for your responses. Regarding your comments on the advantages of Gizmo64 I fully agree. It is indeed a very handy tool/plugin that allows also people like me with quite basic programming skills to achieve great results. Basically, I could realize almost all functionality I wanted for my a/c with this tool/plugin. However, as the plugin meanwhile became payware and can be obtained according to Ben’s post not on a standalone basis but only together with a X-A payware product it is no longer an option for my project. This because I plan to publish it once it will be ready (god knows when) on a free basis and thus people who want to use it would be forced to buy a X-A payware a/c to get the Gizmo64 plugin to run the freeware a/c they want. Please do not take the aforesaid as any criticism, it is just considering a fact. My project is a pure hobby and I am realistic enough to understand that the result will hardly be on a level that asking money for it can be justified. Therefore, I probably must do it the ‘hard way’ and will see how far I get. At least for the moment I am still more excited than frustrated. Back to the problem itself many thanks to you Ben for the hint with xplm_Phase_Gauges and PhM’s comment. Out of your comments I concluded that I perhaps gave a wrong description of my problem/aim. Basically, I would like to write on the 3D panel (instrument) and not somewhere into the 3D space. After reading your comments and again the SDK docs I suspect that there might be a difference. Please find below as example of the Gizmo64/Lua code I use to display on the EFB (which background is in the 3D panel graphic) the current weather of the destination airport. I just wanted to reproduce this option with the SDK; It might be of course again a good argument for Gizmo64 since a could realize this feature quite easily. function OnDraw_Gauges_3D() if efb_power == 1 and efb_mode ==3 then --EFB wheather gl.PushMatrix() gfx.drawString("AIRPORT ", 1820, 580) gfx.drawString(metar_apt, 1820, 560) gfx.drawString("WHEATHER ",1820, 530) gfx.drawString(metar_data1, 1820, 510) gfx.drawString(metar_data2, 1820, 490) gfx.drawString(metar_data3, 1820, 470) gfx.drawString(metar_data4, 1820, 450) gl.PopMatrix() end end I must admit that I do not know whether Gizmo64 interacts directly with XPlane independently from the SDK structure or if they are linked. In case of the latter I assume that there might be a possibility to do it similarly using the SDK? Whatsoever, many thanks already know for additional comments. Best regards SHJ
  5. Hi Can somebody give some help on this topic. I have tried to find as much as possible on the web, however, the information is limited. I have also tested the example http://www.xsquawkbox.net/xpsdk/mediawiki/DrawingHook which works well with my plugin, however, frankly speaking I have a lack of understanding how to continue from this point with the 'string issue'. Although, the following code snippet is probably missing essential parts I include it just to illustrate where am I at the moment with my considerations: XPLMRegisterDrawCallback(My3DTest, xplm_Phase_FirstScene, 0, NULL); XPLMUnregisterDrawCallback(My3DTest, xplm_Phase_LastScene, 0, NULL); int My3DTest( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon) { float color[] = { 1.0, 1.0, 1.0 }; glPushMatrix(); XPLMDrawString(color, 300, 120, "Teststring", NULL, xplmFont_Basic); glPopMatrix(); return 1; } If I understand the SDK documentaton correctly then the xplm_Phases should be correct for 3D drawing. Thank you very much for possible help and best regards SHJ
  6. Hi Jim Thank you very much for your reply + amended file. Now it works. Was indeed a formatting problem. However, I am still struggeling with this issue. Although, I have set the index for the engines correctly (i.e. 0, 1) and saved the file the second engine shows the value of the first one. This despite the fact that the plugin seems to work correctly, i.e. when checking the dataref values with the DRE everythng is correct. For illustration some pics are attached. I am continuing to check this issues, however, perhaps you have an idea what might be the reason. Thanks and regards SHJ
  7. Hi Jim Please find attached the file. Custom dataref is added at the end. Best regards SHJ DataRefs.txt
  8. Hi Jim First of all my best wishes to you for 2018. Thank you for your response. The described approach works fine for the part of PM, i.e. when adding the dataref (SSJ100/SD_FUEL/fuel_used float[2] y kgs custom dataref) to the DataRefs.txt the Index-field gets active and can be edited. However, it creates problems with XP11 itself, i.e. leads to a crash when loading any a/c. To avoid any file formating issues I have amended the DataRefs.txt with the normal Windows text editor. Perhaps you have an idea what might be wrong. Thank you and best regards SHJ
  9. Hi Just to be sure - I have created in my plugin for the a/c a float array custom dataref (fuel consumption per engine). Everything with the code works well. However, I have noted that when using a CUSTOM array dataref in PlaneMaker the corresponding index field is inactive (please refer to attached pic). Am I doing something wrong? Thanks for possible help and best regards SHJ
  10. Hi Ben Thank you very much for your reply and offer. I hope not to disappoint you when saying that I got meanwhile very attracted by this pure programming stuff with the SDK and C++ and will continue this way although I guess that there are a lot of learning lessons ahead to go through. Never thought that I will somewhen start with C++ as it seemd to me very cryptic. Meanwhile, I got at least a first idea about the elegance of this programming language. I am quite optimistic that I will be able to transcribe the basic a/c functions from Gizmo/Lua quite fast, however, will probably get stuck with the 3D graphics stuff which I use for the EFB. Would be great if I could count on some help from you in future. Thank you again for your reply and all the best for 2018! Best regards SHJ
  11. Hi PhM Thank your for your reply. There were basically two reasons for the problem (or maybe just one => ucritical copy/paste) The frst one is: XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterDataAccessor(SSJ100_APU_MSw); vs XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterFlightLoopCallback(SSJ100_APU_MSw); WRONG!!! => copy/paste issue The second one was uncorrect use of variable types (int vs float) in the accessor callbacks for the custom datarefs. Thank you again for your feedback and best regards SHJ
  12. Hi everybody I am about to transcribe a Gizmo64/Lua script into a plugin. Therefore, I had to start learning C++ where I believe made some good progress on the language itself, however, feel still weak with the whole environment (MS VS2017). So far I was working with the SDK2 and just started to try working with the SDK3. All code I have generated based on the SDK2 works well. including custom datarefs (instruction an examples mainly take from here http://www.xsquawkbox.net/xpsdk/mediawiki/Main_Page. As a basis I took the 'Hello World' example and copied i my code from SDK2. Except for the custom datarefs I can compil the project without errors. When adding the custom datarefs I get a compiler error as shown in the attached picture. Woul be great if somebody could provide some help. Thanks and regards SHJ
  13. Hi airfighter Thanks for the confirmation. I have created the rwy/apt from scratch and now it seems to work. I meanwhile have an idea what might have been the reason, however, will have to test it. Once done will let you know. Thanks again and best regards SHJ
  14. Hi airfighter Thanks for the reply. If I see it correctly you have tested it under XP10? I am asking because under XP10 I also do not have this problem. Just under XP11. By the way, adding airport bounderies did not help (under XP11) Best regards SHJ
  15. Hi airfighter Please find attached the scenery file. What I have noticed is that in difference to other sceneries a folder like '+60+060' is missing (?). I guess there are some geographical coordinates? However, such was not created with the scenery by the WED. I had a similar issue with another scenery under XP10 (not this one) where roads where shown on the airfield, There I also tried to add exclusion areas without effect. Solved the problem there in the XP settings by reducing the number of objects (from 'high' to 'normal'). However, I think that's not a good solutuion. Best regards SHJ USMM Nadym.zip
  16. Just to add - I have created this airport really from scratch, including the rwy. It is even not in the airport DB of XP. Does this matter? Thanks and regards SHJ
  17. Yes, I did. Tried also to use WED 1.5, however, same result.
  18. Hi airfighter Nice to hear from you again and thank you for the reply! As I am basically do not deal that much with sceneries I do not understand the meaning/reason for the question. However, as you can see from the attached pic the airport is on top of the file. Best regards SHJ
  19. Hi Would be great if somebody could help with this topic. Just look at the attached pics. Exclusions zones are defined in the WED (apt file exported w/o error messages), however, they seem not to be active. Thank you up front for possible help SHJ P.S: X Plane 11, WED 1.6
  20. Found the mistake: The file path in blender was NOT set to the ac\objects folder but to one of the ac\liveries folders Best regards SHJ
  21. Hi I have started to create some different liveries for my plane (SSJ100), however, they are not loaded in XP. Perhaps, I do there a very basic mistake particular for this plane since I believe to be quite familiar with custom liveries which I created for other plans (i.e. the folder concept etc.). Being in the AC menu of XP or Plane Maker it also correctly displays the differnt livery selection options, however, when selecting them it always displays the one which is selected in Blender as path. Would be great if somebody could give advice. Thank you very much and best regards SHJ
  22. Got the point! Thank you very much! Best regards SHJ
  23. Hi Jim Thank you for the answer. Everything seems to be fine now since I have noticed that in the XP10 settings the shadow mode was not set correctly (changed 'overlay' to '3D on acf'). Using the opportunty of writing this post perhaps I can ask you for a short but very basic answer/hint. As I have started a next project (MC21) I am wondering whether it is necessary to model in PlaneMaker objects when I intent to use only objects which are created in Blender, i.e. is any modelling in PlaneMaker however required to provide flight characteristics etc.for the plane? Thank you again very much and best regards SHJ
  24. Hi Jim Strange thing! First of all you seem to be right regarding the shadow checking. I noticed that I did not select 'shadow mode' for the acf objects in PlaneMaker. Having corrected this the icon is now visible. However, no shadow from the plane can be seen!? Any idea why. Thanks up fornt for help. Best regards SHJ
  25. Hi Jim Thank you for the feedback. I will check it accordingly and let you know the outcome. Thanks again and best regards SHJ
×
×
  • Create New...