Показать сообщение отдельно
Старый 19.09.2005, 17:14   #14
SubZer0
Администратор
 
Аватар для SubZer0
 
Регистрация: 03.09.2005
Сообщений: 2,408
Написано 301 полезных сообщений
(для 996 пользователей)
изменил код, как и просили...

сам код:

Graphics3D 1024,768,32,1

l = CreateLight()
RotateEntity l, 0, 45, 45
level=LoadMesh ("MAPS\TUR.3ds") 
grunt=LoadTexture("Panels.jpg")
EntityTexture level,grunt
PositionEntity level,0,-7,0
ry# = -8
dy# = 0 
If KeyDown(57) Then
If ry# = -8 Then dy# = 0
EndIf
ry# = ry# + dy#
dy# = dy# - 0.1
If ry# < -8 Then ry# = -8: dy# = 0
robot = LoadAnimMesh( "ROBOT\robotic.3ds" )
LoadAnimSeq robot, ("ROBOT\running.3ds" )
ScaleEntity robot, 0.4, 0.4, 0.4


camobject=createsphere(4,robot)
entityalpha camobject,0
positionentity camobject,0,0,0

cam = CreateCamera(camobject)


CameraRange cam, 5,2000
CameraFogColor cam, 0,128,255 
CameraFogRange cam, 1,1000 
camerazoom cam,1
cZoom#=1

PositionEntity cam, 0, 60, 40
RotateEntity cam, 30, 180, 0
EntityType robot,1
EntityRadius robot, 0
EntityType level,2

Collisions 1, 2,2, 2


cub=CreateCube()
PositionEntity cub,10,5,10
cub3=CreateCube()
PositionEntity cub3,10,5,-10
ScaleEntity cub3 ,10, 10, 10
cone=CreateCube() 
PositionEntity cone,5,5,10
;golova=CreateSphere ()
;PositionEntity golova ,10,10,30


entitypickmode cone,2
entitypickmode cub,2
entitypickmode cub3,2
entitypickmode robot,2

rx# = 10
ry# = -8
rz# = 30
dy# = 0
ang = 90
Repeat
PositionEntity robot, rx#, ry#, rz#
RotateEntity robot, 0, ang + 90, 0
If KeyDown(57) Then
If ry# = -8 Then dy# = 3
EndIf
ry# = ry# + dy#
dy# = dy# - 0.1
If ry# < -8 Then ry# = -8: dy# = 0
If KeyDown(17)
If AnimSeq(robot) = 0 Then Animate robot, 1, 0.5, 1, 10
rx# = rx# + Cos(ang) * 0.5
rz# = rz# + Sin(ang) * 0.5
Else
If AnimSeq(robot)=1 Then Animate robot, 2, 1, 0, 10
EndIf


angy#=MouseYSpeed()/2 
moveEntity cam, 0, angy, 0 


;==============================


ang = ang - MouseXSpeed()/1.5



;======================================================================= ==
PointEntity cam,robot 
If KeyDown(44) Then MoveEntity cam,0,-0.5,0
If KeyDown(45) Then MoveEntity cam,0,0.5,0
If KeyDown (46) Then MoveEntity cam,0,0,-2
If KeyDown(47) Then MoveEntity cam,0,0,2

MoveMouse GraphicsWidth()/2, GraphicsHeight()/2 

If KeyDown(203) Then ang = ang + 3
If KeyDown (205) Then ang = ang - 3
If KeyDown (208) Then anglex = anglex + 3
If KeyDown(1) Then Exit

cZoom=cZoom+MouseZSpeed()*0.5
camerazoom cam,cZoom


;If KeyDown (2) TurnEntity cam,2,0,0
;If KeyDown (42) Then CameraZoom cam, 1.5
;If Not KeyDown (42) Then CameraZoom cam,1
;If KeyDown (54) Then CameraFogMode cam,1 
;If Not KeyDown (54) Then CameraFogMode cam,0 


UpdateWorld
RenderWorld
;-----------------------------------------------------------------------------------------------
If EntityInView(cone,cam) And linepick(EntityX(cam,True),EntityY(cam,True),EntityZ(cam,True), EntityX(cone)-EntityX(cam,True),EntityY(cone)-EntityY(cam,True),EntityZ(cone)-EntityZ(cam,True))=cone
 cameraProject(cam,EntityX(cone),EntityY(cone),EntityZ(cone))
 Color 0, 0, 128 :Text ProjectedX#(),ProjectedY#(),"Bordos"
End If 
;====================================================
If EntityInView(cub,cam) And linepick(EntityX(cam,True),EntityY(cam,True),EntityZ(cam,True), EntityX(cub)-EntityX(cam,True),EntityY(cub)-EntityY(cam,True),EntityZ(cub)-EntityZ(cam,True))=cub
 CameraProject(cam,EntityX(cub),EntityY(cub),EntityZ(cub)) 
 Color 0, 128, 0:Text ProjectedX#(),ProjectedY#(),"Wiliams"
EndIf 
;===================================================== 

Flip
Forever

end
а тут можешь скачать рабочую версию.... там только с Зумом поиграться надо, чтоб настроить
__________________
Как минимум я помог многим (с)
(Offline)
 
Ответить с цитированием