Перейти к содержимому


Фотография
- - - - -

Вопросы по Гмакс и не только(+Дайджест)


Тема находится в архиве. Это значит, что в нее нельзя ответить.
Для разархивирования этой темы отправьте сообщение с указанием URL топика
Сообщений в теме: 24

#21 EugSh

EugSh

    Специалист

  • Members
  • PipPipPip
  • 174 сообщений
    Reputation: 0

Отправлено 24 February 2003 - 11:00

Самому описывать лень :D
Вот рекомендации от Arno Gerretsen:

If you want to have seasonal textures on your object made in GMax, you can get it by making the following changes to the BGLC source code.
Here is an example of a simple box, as GMax makes it (so with a fixed texture):

test_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 54.999468, "TEST.BMP" ; 0
TEXTURE_LIST_END

MATERIAL_LIST_BEGIN
MATERIAL_DEF 1.000000,1.000000,1.000000,1.000000, 0.392157,0.392157,0.392157,0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0
MATERIAL_LIST_END

VERTEX_LIST_BEGIN
VERTEX_DEF -75.080002,0.000000, 68.136002, -1.000000, 0.000000, 0.000000, 0.000000,0.000000 ;0 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, 68.136002, 0.000000,-1.000000, 0.000000, 1.000000,1.000000 ;1 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, 68.136002, 0.000000, 0.000000, 1.000000, 1.000000,0.000000 ;2 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, -78.232002, -1.000000, 0.000000, 0.000000, 1.000000,0.000000 ; 3 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, -78.232002, 0.000000,-1.000000, 0.000000, 1.000000,0.000000 ;4 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, -78.232002, 0.000000, 0.000000,-1.000000, 0.000000,0.000000 ;5 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, 68.136002, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ;6 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, 68.136002, 0.000000, 0.000000, 1.000000, 1.000000,1.000000 ;7 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, 68.136002, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ;8 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, -78.232002, -1.000000, 0.000000, 0.000000, 1.000000,1.000000 ; 9 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, -78.232002, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ;10 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, -78.232002, 0.000000, 1.000000, 0.000000, 0.000000,0.000000 ;11 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, 68.136002, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ;12 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, 68.136002, 0.000000, 0.000000, 1.000000, 0.000000,0.000000 ;13 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, 68.136002, 1.000000, 0.000000, 0.000000, 1.000000,0.000000 ;14 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, -78.232002, 0.000000,-1.000000, 0.000000, 0.000000,0.000000 ;15 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, -78.232002, 0.000000, 0.000000,-1.000000, 1.000000,0.000000 ;16 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, -78.232002, 1.000000, 0.000000, 0.000000, 0.000000,0.000000 ;17 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, 68.136002, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ;18 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, 68.136002, 0.000000, 1.000000, 0.000000, 1.000000,1.000000 ;19 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, 68.136002, 1.000000, 0.000000, 0.000000, 1.000000,1.000000 ;20 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, -78.232002, 0.000000, 0.000000,-1.000000, 1.000000,1.000000 ;21 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, -78.232002, 0.000000, 1.000000, 0.000000, 1.000000,0.000000 ;22 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, -78.232002, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ;23 part= 1 prim=0
VERTEX_LIST_END

; NonAlpha
test_NonAlpha label BGLCODE

MATERIAL 0,0 ; <255,255,255,255> TEST.BMP;;;

DRAW_TRI_BEGIN 0, 24
DRAW_TRI 17, 14, 20 ; poly=7 part=1
DRAW_TRI 12, 15, 4 ; poly=2 part=1
DRAW_TRI 11, 22, 19 ; poly=3 part=1
DRAW_TRI 19, 8, 11 ; poly=4 part=1
DRAW_TRI5, 16, 21 ; poly=5 part=1
DRAW_TRI 21, 10, 5 ; poly=6 part=1
DRAW_TRI4, 1, 12 ; poly=1 part=1
DRAW_TRI 20, 23, 17 ; poly=8 part=1
DRAW_TRI 13, 2, 7 ; poly=9 part=1
DRAW_TRI7, 18, 13 ; poly=10 part=1
DRAW_TRI0, 3, 9 ; poly=11 part=1
DRAW_TRI9, 6, 0 ; poly=12 part=1
DRAW_TRI_END
BGL_END
BGL_RETURN


Now make the following changes to this code to get the seasonal texture change:

test_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 54.999468, "TEST.BMP" ; 0
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 54.999468, "TEST_WI.BMP" ; 1
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 54.999468, "TEST_SP.BMP" ; 2
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 54.999468, "TEST_FA.BMP" ; 3
TEXTURE_LIST_END

MATERIAL_LIST_BEGIN
MATERIAL_DEF 1.000000,1.000000,1.000000,1.000000, 0.392157,0.392157,0.392157,0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0
MATERIAL_LIST_END

VERTEX_LIST_BEGIN
VERTEX_DEF -75.080002,0.000000, 68.136002, -1.000000, 0.000000, 0.000000, 0.000000,0.000000 ;0 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, 68.136002, 0.000000,-1.000000, 0.000000, 1.000000,1.000000 ;1 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, 68.136002, 0.000000, 0.000000, 1.000000, 1.000000,0.000000 ;2 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, -78.232002, -1.000000, 0.000000, 0.000000, 1.000000,0.000000 ; 3 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, -78.232002, 0.000000,-1.000000, 0.000000, 1.000000,0.000000 ;4 part= 1 prim=0
VERTEX_DEF -75.080002,0.000000, -78.232002, 0.000000, 0.000000,-1.000000, 0.000000,0.000000 ;5 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, 68.136002, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ;6 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, 68.136002, 0.000000, 0.000000, 1.000000, 1.000000,1.000000 ;7 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, 68.136002, 0.000000, 1.000000, 0.000000, 0.000000,1.000000 ;8 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, -78.232002, -1.000000, 0.000000, 0.000000, 1.000000,1.000000 ; 9 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, -78.232002, 0.000000, 0.000000,-1.000000, 0.000000,1.000000 ;10 part= 1 prim=0
VERTEX_DEF -75.080002, 141.328003, -78.232002, 0.000000, 1.000000, 0.000000, 0.000000,0.000000 ;11 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, 68.136002, 0.000000,-1.000000, 0.000000, 0.000000,1.000000 ;12 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, 68.136002, 0.000000, 0.000000, 1.000000, 0.000000,0.000000 ;13 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, 68.136002, 1.000000, 0.000000, 0.000000, 1.000000,0.000000 ;14 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, -78.232002, 0.000000,-1.000000, 0.000000, 0.000000,0.000000 ;15 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, -78.232002, 0.000000, 0.000000,-1.000000, 1.000000,0.000000 ;16 part= 1 prim=0
VERTEX_DEF 105.360008,0.000000, -78.232002, 1.000000, 0.000000, 0.000000, 0.000000,0.000000 ;17 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, 68.136002, 0.000000, 0.000000, 1.000000, 0.000000,1.000000 ;18 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, 68.136002, 0.000000, 1.000000, 0.000000, 1.000000,1.000000 ;19 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, 68.136002, 1.000000, 0.000000, 0.000000, 1.000000,1.000000 ;20 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, -78.232002, 0.000000, 0.000000,-1.000000, 1.000000,1.000000 ;21 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, -78.232002, 0.000000, 1.000000, 0.000000, 1.000000,0.000000 ;22 part= 1 prim=0
VERTEX_DEF 105.360008, 141.328003, -78.232002, 1.000000, 0.000000, 0.000000, 0.000000,1.000000 ;23 part= 1 prim=0
VERTEX_LIST_END

; NonAlpha
test_NonAlpha label BGLCODE

IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> TEST_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> TEST_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> TEST.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> TEST_FA.BMP;;;
tex_verder label word

DRAW_TRI_BEGIN 0, 24
DRAW_TRI 17, 14, 20 ; poly=7 part=1
DRAW_TRI 12, 15, 4 ; poly=2 part=1
DRAW_TRI 11, 22, 19 ; poly=3 part=1
DRAW_TRI 19, 8, 11 ; poly=4 part=1
DRAW_TRI5, 16, 21 ; poly=5 part=1
DRAW_TRI 21, 10, 5 ; poly=6 part=1
DRAW_TRI4, 1, 12 ; poly=1 part=1
DRAW_TRI 20, 23, 17 ; poly=8 part=1
DRAW_TRI 13, 2, 7 ; poly=9 part=1
DRAW_TRI7, 18, 13 ; poly=10 part=1
DRAW_TRI0, 3, 9 ; poly=11 part=1
DRAW_TRI9, 6, 0 ; poly=12 part=1
DRAW_TRI_END
BGL_END
BGL_RETURN


As you can see I added all the seasonal variants to the texture list and then choose the right material depending on the value of the season variable. If you object already had more then one texture you must be carefull to use the right numbers to link the texture to the material.
During my search for a solution I also found some other BGLC commands, like TEXTURE_SEASON, and I think with these commands it should be even easier to get seasonal texture changes, but untill now I couldn't get them to work. If I find a better way I will place it here too of course. This way, with the variable check, is the way we had to do it in Fs98 and before.

#22 Albert Slovak

Albert Slovak

    Новичок

  • Members
  • PipPipPipPip
  • 348 сообщений
    Reputation: -5

Отправлено 24 February 2003 - 13:05

ну что же. Сделал всё в точности как написано, но вот что странно. После компиляции asm-а получается два файла, один из низ kurgan.asm, а второй kurgan_0.asm. Правим kurgan_0.asm. А потом чего делать? Компилим kurgan_0.asm и получается kurgan_0.bgl. Вопрос: чего делать с kurgan.bgl? Или оба эти файла должны остаться в директории сцены?

#23 Dancer

Dancer

    Участник

  • Members
  • PipPipPipPip
  • 430 сообщений
    Reputation: 5

Отправлено 24 February 2003 - 15:32

Удали создавшийся bgl. Выдели оба asm. , нажми правую клавишу мышки , подведя её к строчке БЕЗ нуля. Открыть с помощью---- >> BGLC.
Всё компильнётся в единый bgl.
Удачи .

#24 Albert Slovak

Albert Slovak

    Новичок

  • Members
  • PipPipPipPip
  • 348 сообщений
    Reputation: -5

Отправлено 24 February 2003 - 17:05

пасиб, но нет почему-то сезонных. а если еще и первый файл правлю, то ошибку выдает поганец ;)

в первом файле делаю вот это:

вот этот блок

OBJECT_0_START label word
IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767
ADDOBJ OBJECT_0_SCALE
SHADOW_CALL OBJECT_0_SCALE

заменяю вот таким

OBJECT_0_START label word
IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767
ADDCAT OBJECT_0_SCALE, 24


во втором файле, который _0.asm делаю следующее:

вот этот блок

kurgan_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 5.708286, "ASPH4.BMP" ; 0
TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 27.945065, "GRASS.BMP" ; 1
TEXTURE_LIST_END

заменяю вот этим

kurgan_top label BGLCODE
BGL_BEGIN 0800h ; version = 8.00
TEXTURE_LIST_BEGIN
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 5.708286, "ASPH4.BMP" ; 0
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 24.757660, "ASPH4_WI.BMP" ; 1
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 24.757660, "ASPH4_SP.BMP" ; 2
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 24.757660, "ASPH4_FA.BMP" ; 3
TEXTURE_DEF TEXTURE2_NIGHT , <255,255,255,255>, 5.708286, "ASPH4_LM.BMP" ; 4
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 27.579211, "GRASS.BMP" ; 5
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 24.757660, "GRASS_WI.BMP" ; 6
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 24.757660, "GRASS_SP.BMP" ; 7
TEXTURE_DEF TEXTURE_AIRCRAFT, <255,255,255,255>, 24.757660, "GRASS_FA.BMP" ; 8
TEXTURE_DEF TEXTURE2_NIGHT , <255,255,255,255>, 27.579211, "GRASS_LM.BMP" ; 9
TEXTURE_LIST_END

потом вот тут еще добавляю

; NonAlpha
kurgan_NonAlpha label BGLCODE
IFIN1 tex_01, 0000006f8h, 0, 0
MATERIAL 0,1 ; <255,255,255,255> ASPH4_WI.BMP;;;
JUMP tex_verder
tex_01 label word
IFIN1 tex_02, 0000006f8h, 1, 1
MATERIAL 0,2 ; <255,255,255,255> ASPH4_SP.BMP;;;
JUMP tex_verder
tex_02 label word
IFIN1 tex_03, 0000006f8h, 2, 2
MATERIAL 0,0 ; <255,255,255,255> ASPH4.BMP;;;
JUMP tex_verder
tex_03 label word
MATERIAL 0,3 ; <255,255,255,255> ASPH4_FA.BMP;;;
tex_verder label word

и не компилит, грит что ошибки там какие-то...
может из-за того, что для GRASS не прописан второй блок? и как его тогда писать подскажите плз, а то что-то путаюсь я ;(

#25 EugSh

EugSh

    Специалист

  • Members
  • PipPipPip
  • 174 сообщений
    Reputation: 0

Отправлено 25 February 2003 - 09:51

Ну дык пропиши второй блок и попробуй.
А ругается то какими словами?
Кстати, меня тут у тебя еще ночные текстуры смущают. Без них не пробовал? Хотя может и показалось...