Jump to content
Sign in to follow this  
Guest Cazador

Placing two or more gmax library object in one .bgl fil

Recommended Posts

Guest Cazador

Dear All:I'm learnig the gmax software with some difficulty, i can get a library object from the .asm files from my object, but FSregen just allow me to create one bgl file per object library.Is there a way to include in one bgl files two or more gmax object library?I don't want to create a lot of small bgl files for each gmax object i made.Thanks.Alfredo Mendiola LoyolaLima Peru

Share this post


Link to post
Share on other sites
Guest

Yup the easy way is to simply export all your objects as a scene at one time you would however need to make a scaled template of your airport to place your objects correctly. Dan

Share this post


Link to post
Share on other sites
Guest christian

I'm not using fsregen (yet), simply because I know BGLC relatively well. I have not done what you want as yet, just manually edited a asm file and made it a library. However, putting several objects into one library is easy, just merge the asm files and add appropriate commands. Below is some code that should help you getting started. Also, read the 2000 scenery SDK, that should help understand my code...Cheers, Christian;compile with BGLC /BGL C:gamesgmaxmeshespylon2.asmheader label word dw 0001 ; 00 World set number dd -5100467 ; North Bound dd -5177830 ; South Bound dd 2033585983 ; East Bound dd 2005386899 ; West Bound dw 22 dup(0) ;changed + 2 for lib dd (offset OBJECT_DATA) - (offset header) dw 10 dup(0) dd 05287D2B9h dd 071C24563h dd 05287D2B9h dd 071C24563h dw 13 dup(0) ;changed for lib OBJECT_DATA label word ; db 21 ;;LATBAND_REL ; dw 0225Eh ;;lat min (inclusive) 512M units; dw 02260h ;;lat max (exclusive) ; dd (offset OBJECT_0) - (offset OBJECT_DATA) ; db 0 ;;EOL ;LIBRARY_INDEX dd (offset OBJECT_0) - (offset OBJECT_DATA) dd 05287D2B9h, 071C24563h, 0A77FD245h, 0473714AFh ;GUID db 0 ;EOLOBJECT_0 label BGLCODE; db 12 ; NEAR_FAR_HUGE_OBJECT_HEADER; dd 00044BEB5h,02061C9C7h ; latitude,longitude ; db 100 ; image power ; dd (offset OBJECT_0_END) - (offset OBJECT_0) ;LIBRARY_HEADER dd 05287D2B9h, 071C24563h, 0A77FD245h, 0473714AFh ;GUID db 0 ;power dd (offset OBJECT_0_START) - (offset OBJECT_0) dd (offset OBJECT_0_END) - (offset OBJECT_0) dd 992 ;size dd 00020000h ;scale dd 0 ;library type dd 0 ;library properties db "nz_gen_pylon",0OBJECT_0_START label word; IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767; ADDOBJ OBJECT_0_SCALE; SHADOW_CALL OBJECT_0_SCALE;OBJECT_0_FAIL label BGLCODE; BGL_JUMP_32 OBJECT_0_END ;OBJECT_0_SCALE label BGLCODE; SCALE_AGL OBJECT_0_RETURN, 10000, 992, 131072, 00044BEB5h, 0C408h, 02061C9C7h, 0F5EDh, 0, 0 VAR_BASE_OVERRIDE 0; added for lib BGL_CALL OBJECT_0_BEGINOBJECT_0_RETURN label word BGL_RETURNOBJECT_0_BEGIN label wordmodel_outside label BGLCODE BGL_CALL model_crashmodel_shadow label BGLCODELOD_0 label BGLCODE BGL_JUMP_32 LOD_0Lmodel_inside label BGLCODE BGL_RETURN BGL_RETURN ;added for libmodel_crash label BGLCODE BGL_CRASH_START model_crash_end, 375don't modify the rest...

Share this post


Link to post
Share on other sites
Guest Cazador

Dear Christian:Could you explainme the header please?;compile with BGLC /BGL C:gamesgmaxmeshespylon2.asmheader label worddw 0001 ; 00 World set number dd -5100467 ; North Bounddd -5177830 ; South Bounddd 2033585983 ; East Bounddd 2005386899 ; West BoundHow convert the coordinate * ' '' to those numbers?dw 22 dup(0) ;changed + 2 for lib dd (offset OBJECT_DATA) - (offset header)dw 10 dup(0)dd 05287D2B9hdd 071C24563hdd 05287D2B9hdd 071C24563h dw 13 dup(0) ;changed for lib

Share this post


Link to post
Share on other sites
Guest Cazador

Dear Christian:I need to write the scale, power, etc like Section 10 scenery library?Thanks.Alfredo Mendiola LoyolaLima Peru

Share this post


Link to post
Share on other sites
Guest christian

To convert from degrees to the numbers you have to read the scenery SDK.Basically, for latitude you have to convert to metres, there is a number in the SDK which gives you the earth circumference around the poles. Use that and '360* = circumference' and you're set.For longitude you have to 'rescale' to pseudodegrees. That means your longitude gets mapped to 4 full bytes, so its 2^32 = 360*.If you read my code you find comments in the LIBRARY_HEADER for scale, power, etc. I found power is always 0 and scale doesn't work. That's because you have to call the library object with SCALE_AGL anyway and the values there seem to overwrite the library values...Cheers, Christian

Share this post


Link to post
Share on other sites
Guest manny3

I'm exporting my gmax objects to a temporary folder and make a library of several objects using FSRegen.The I make a scasm library caller api for each object. This allows me to put individual objects exactly where I want them using Airport 2.90. I think visibility and complexity can even be controlled this way, including object heading.What I'm not sure is if this will impact frame rate.But FSRegen allows me to put several objects in one bgl file. I have version 3.1bManny

Share this post


Link to post
Share on other sites

Hi Alfredo,You can add more then one file in the library compiler screen. Just select the second file once you have added the first, fill in all parameters and then click Add to list again. The same for the third, fourth, ... object. I think you get the idea now :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest Cazador

Thanks you to everybody that help me...Alfredo Mendiola LoyolaLima Peru

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...