Извините, ничего не найдено.

Не расстраивайся! Лучше выпей чайку!
Регистрация
Справка
Календарь

Вернуться   forum.boolean.name > Программирование игр для компьютеров > Blitz3D > 3D-программирование

3D-программирование Вопросы, касающиеся программирования 3D мира

Ответ
 
Опции темы
Старый 23.02.2010, 12:51   #1
Colossus
Разработчик
 
Аватар для Colossus
 
Регистрация: 12.10.2008
Адрес: Самара
Сообщений: 437
Написано 55 полезных сообщений
(для 92 пользователей)
Печаль вылетает MAV

Вобщем написал я такой кодик:

Graphics3D 800,600,32,1
AmbientLight 255,255,255
SetBuffer BackBuffer()
;--------------------------------------------------------------
Font=LoadFont("Arial",20)
SetFont Font
;--------------------------------------------------------------
CentreX=GraphicsWidth()/2
CentreY=GraphicsHeight()/2
;--------------------------------------------------------------
MaxAnimations=64
MaxChildren=256
MaxFrames=16
MaxFramesInAnimation=512
MaxEntities=3
MMAB_Init(MaxAnimations,MaxChildren,MaxFrames,MaxFramesInAnimation,MaxEntities)
;--------------------------------------------------------------
Cam_Pivot=CreatePivot()
Cam=CreateCamera()
EntityParent Cam,Cam_Pivot
PositionEntity Cam,0,5,25
PointEntity Cam,Cam_Pivot
CameraRange Cam,0.1,999999
PositionEntity Cam_Pivot,0,8,0
;--------------------------------------------------------------
plane=CreatePlane()
planetex=LoadTexture("Test_tex.jpg")
ScaleTexture planetex,10,10
EntityTexture plane,planetex
;--------------------------------------------------------------
a.human=CreateHuman(0,0,0)
;--------------------------------------------------------------
p.pistol=CreatePistol()
;--------------------------------------------------------------
HumanGivePistol(a,p)
;--------------------------------------------------------------
Speed#=1.0
Trans#=1.0
;--------------------------------------------------------------
While Not KeyHit(1)
;--------------------------------------------------------------
If p\ammo<>0 Then 
   	UpdatePistol(p.pistol)
ElseIf p\ammo=0 Then 
   	UpdatePistol2(p.pistol)
EndIf
;--------------------------------------------------------------
fps=fps+1
If MilliSecs()>fpstime
fpstime=MilliSecs()+1000
fpsc=fps
fps=0
EndIf
;--------------------------------------------------------------
Mx=Mx+MouseXSpeed()*.5
My=My+MouseYSpeed()*.5
RotateEntity Cam_Pivot,-My,-Mx,0
MoveMouse CentreX,CentreY
;--------------------------------------------------------------
;PositionEntity Cam_Pivot,EntityX(Human,1),EntityY(Human,1)+10,EntityZ(Human,1)
;MoveEntity Cam_Pivot,-3, 8, 0
;--------------------------------------------------------------
UpdateHuman(a.human)
;UpdatePistol(p.pistol)
UpdateWorld
RenderWorld
;--------------------------------------------------------------
Text 10,10,"FPS: "+fpsc
;--------------------------------------------------------------
Text 10,30,"Ammo: "+p\ammo+" \ "+p\ammo_supply
;--------------------------------------------------------------
MMAB_Process(Speed#,100)
;--------------------------------------------------------------
;Text CentreX,CentreY,"[ + ]"
;--------------------------------------------------------------
Flip
Wend
End
;--------------------------------------------------------------
Type Human
	Field ent%
	Field x#,y#,z#
	Field body%
	Field r_hand%
	Field l_hand%
	Field pist.pistol
	Field idle_leg%
	Field idle_pistol%
	Field shoot_pistol%
	Field run_leg%
End Type
;--------------------------------------------------------------
Type Pistol
	Field ent%
	Field flash%
	Field shoot_anim%
	Field shoot_sound%
	Field ammo%
	Field empty_sound%
	Field empty_anim%
	Field ammo_supply%
	Field shutter_anim%
	Field shutter_sound%
End Type
;--------------------------------------------------------------
Function CreateHuman.human(x#,y#,z#)
     	a.Human = New Human
     	a\ent=LoadAnimMesh("Human.b3d")
     	ScaleEntity a\ent,0.1,0.1,0.1
     	PositionEntity a\ent,x#,y#,z#
     	a\body=FindChild(a\ent,"sportive08_m_mediumpoly")
     	a\r_hand=FindChild(a\ent,"Bip01 R Hand")
     	a\l_hand=FindChild(a\ent,"Bip01 L Hand")
	a\idle_leg=MMAB_LoadAnimation(a\ent,"Human_Anim\Idle_Leg.bla")
	a\idle_pistol=MMAB_LoadAnimation(a\ent,"Human_Anim\Idle_pistol.bla")
	a\shoot_pistol=MMAB_LoadAnimation(a\ent,"Human_Anim\Shoot_pistol.bla")
	a\run_leg=MMAB_LoadAnimation(a\ent,"Human_Anim\Hum_Run_Leg.bla")
	Return a
End Function
;--------------------------------------------------------------
Function UpdateHuman(a.human)
If KeyDown(17)
	MMAB_Animate(a\run_leg,1,7,40,Trans#/2,1)
	MMAB_Animate(a\idle_pistol,1,7,40,Trans#/2,1)
	MMAB_Animate(a\idle_leg,0,0,0,0,0)
Else
	MMAB_Animate(a\run_leg,0,0,0,0,0)
	MMAB_Animate(a\idle_pistol,0,0,0,0,0)
	MMAB_Animate(a\idle_leg,1,0,10,Trans#/2,1)
EndIf
End Function
;--------------------------------------------------------------
Function CreatePistol.pistol()
     	p.Pistol = New Pistol 
     	p\ent=LoadAnimMesh("desert eagle\Desert_Eagle.b3d")
     	ScaleEntity p\ent,0.15,0.15,0.15 
	p\flash=FindChild(p\ent,"Muzle")
	p\shoot_anim=ExtractAnimSeq(p\ent,0,6)
	p\empty_anim=ExtractAnimSeq(p\ent,3,3)
	p\shutter_anim=ExtractAnimSeq(p\ent,3,6)
	p\shoot_sound=LoadSound("wav\de_shoot.wav")
	p\empty_sound=LoadSound("wav\de_dryfire.wav")
	p\shutter_sound=LoadSound("wav\de_cliprelease.wav")
	p\ammo=7
	p\ammo_supply=21
     	Return p
End Function
;--------------------------------------------------------------
Function UpdatePistol(p.pistol)
If MouseHit(1) Then 
	Animate p\ent,3,1,p\shoot_anim
	PlaySound p\shoot_sound
	p\ammo=p\ammo-1
EndIf

If p\ammo<=0 Then p\ammo=0

End Function
;--------------------------------------------------------------
Function UpdatePistol2(p.pistol)
If MouseHit(1) Then 
     	Animate p\ent,3,1,p\empty_anim
     	PlaySound p\empty_sound
     	p\ammo=p\ammo-1
EndIf

If p\ammo<=0 Then p\ammo=0

If KeyHit(19) Then
	Animate p\ent,3,1,p\shutter_anim
	PlaySound p\shutter_sound
	p\ammo=p\ammo+7
	p\ammo_supply=p\ammo_supply-7
EndIf

If p\ammo_supply<=0 Then p\ammo_supply=0
End Function
;--------------------------------------------------------------
Function HumanGivePistol(h.Human,p.pistol)
	h\pist=p
 	PositionEntity(p\ent,EntityX(h\r_hand,1)-0.5,EntityY(h\r_hand,1)-0.8,EntityZ(h\r_hand,1)-0.2,1)
	RotateEntity(p\ent,EntityPitch(h\r_hand,1)-90,EntityYaw(h\r_hand,1),EntityRoll(h\r_hand,1),1)
 	EntityParent(p\ent,h\r_hand)
End Function
;--------------------------------------------------------------
компилится запускается и вылетает MAV ругается на
MMAB_Process(Speed#,100)
люди кто работал с блендером анимаций от MadMedic'а, помогите разобраться, че я тут не так накодил?
__________________
Пекарня: Intel Core i3 - 3240(3.40Ghz), ram 8 gb, video Gigabyte Nvidia GeForce GTX 650 1gb

Лэптоп : Intel Core i3 - 2365(1.40Ghz), ram 4gb, video Int Intel HD3000(512mb)

Мой набор: 3ds Max 9 + Xors3d(Blitz3d) + Photoshop
(Offline)
 
Ответить с цитированием
Ответ


Опции темы

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


Часовой пояс GMT +4, время: 15:29.


vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot
Style crйe par Allan - vBulletin-Ressources.com