Хм, меня заинтересовала эта хрень
Вот в аттаче работающий пример.
Поначалу сбило с толку то, что дурень Марк сделал возвращаемый параметр ф-ии EntityClass строчкой, вместо чеовеческих Интов. FFFFFFUUUUU
Note that the command will fail if a valid entity handle is not supplied, and will not just return an empty string.
Example
; EntityClass Example
; -------------------
Graphics3D 640,480,16
SetBuffer BackBuffer()
SeedRnd MilliSecs()
; Select a random number between 0 and 7 then create a certain class of entity depending on the number selected
i=Rand(0,7)
Select i
Case 0 ent=CreatePivot()
Case 1 ent=CreateLight()
Case 2 ent=CreateCamera()
Case 3 ent=CreateMirror()
Case 4 ent=CreateSprite()
Case 5 ent=CreateTerrain(32)
Case 6 ent=CreatePlane()
Case 7 ent=CreateMesh()
;Case 8 ent=CreateListener(parent)
;Case 9 ent=LoadMD2(md2_file$)
;Case 10 ent=LoadBSP(bsp_file$)
End Select
; Get the class of the entity
class$=EntityClass$(ent)
; Output the class to the screen
Text 0,0,"A "+class$+" was created."
Сообщений: 3,639
Написано 832 полезных сообщений (для 2,013 пользователей)
Ответ: Проблемы LoadAnimMesh
я тебе не верю код покажи.
вооще-то уже разобрался !! спасибо !!
просто я брал фукцию (AnimEntityTexture) с сорсов ВарТича !!
в коде АВТОМАТА немного другая ф-ция (AnimEntityTexture_NEW) - она работает !!
в атаче код с медией, если будет время - глянь !! у меня 1 ф-ция работает вторая нет !!
Graphics3D 800,600,32,2
SetBuffer BackBuffer()
cam = CreateCamera()
CameraClsColor cam,64,64,64
PositionEntity cam,0,150,-200
bot = LoadAnimMesh("1.b3d")
bot_anim = LoadAnimSeq(bot, "anim_walk.b3d")
MoveEntity bot,0,-30,100
Animate bot,1,1,bot_anim
; загружаем текстуру-маску
m_tex = LoadTexture("man_MM.jpg",4)
; загружаем диффуз-текстуру с кровью
d_tex_blood = LoadTexture("man_blood_DM.jpg",1)
; Работает !!
AnimEntityTexture_NEW(bot,m_tex,0,0);
AnimEntityTexture_NEW(bot,d_tex_blood,0,1)
; Почему-то НЕ работает !!
; AnimEntityTexture(bot,m_tex,0,0)
; AnimEntityTexture(bot,d_tex_blood,0,1)
Repeat
TurnEntity bot,0,0.3,0
RenderWorld()
UpdateWorld()
Text 10,10, EntityClass(bot)
Flip
Until KeyHit(1)
End
Function AnimEntityTexture_NEW(ent, tex,flag=0,level=0)
If EntityClass(ent) = "Mesh" Then
EntityTexture ent,tex,0,level
End If
For i=1 To CountChildren(ent)
AnimEntityTexture_NEW(GetChild(ent,i),tex,0,level)
Next
End Function
Function AnimEntityTexture(aent,tex,frame=0,layer=0)
Local ent
EntityTexture aent,tex,frame,layer
For c=1 To CountChildren(aent)
ent=GetChild(aent,c)
If CountChildren(ent)>0
AnimEntityTexture(ent,tex,frame,layer)
Else
If EntityClass(ent)="Mesh" Then EntityTexture ent,tex,frame,layer
EndIf
Next
End Function