Модератор
Регистрация: 11.07.2007
Сообщений: 2,910
Написано 686 полезных сообщений (для 1,694 пользователей)
|
Ответ: Пулеметчик
Terminator, ты гений просто прямо!
там, если я не ошибаюсь, надо проецировать Х и У прямоугольника туда ,где самолет, так? вроде бы ProjectedX и Y

Graphics3D 640,480
SetBuffer BackBuffer()
camera=CreateCamera()
PositionEntity camera,0,2,-10
light=CreateLight()
RotateEntity light,90,0,0
plane=CreatePlane()
cube=CreateCube()
PositionEntity cube,0,1,0
While Not KeyDown( 1 )
If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
; Use camera project to get 2D coordinates from 3D coordinates of cube
CameraProject(camera,EntityX(cube),EntityY(cube),E ntityZ(cube))
RenderWorld
; If cube is in view then draw text, if not then draw nothing otherwise text will be drawn at 0,0
If EntityInView(cube,camera)=True
; Use ProjectedX() and ProjectedY() to get 2D coordinates from when CameraProject was used.
; Use these coordinates to draw text at a 2D position, on top of a 3D scene.
Text ProjectedX#(),ProjectedY#(),"Cube"
EndIf
Text 0,0,"Use cursor keys to move about"
Text 0,20,"ProjectedX: "+ProjectedX#()
Text 0,40,"ProjectedY: "+ProjectedY#()
Text 0,60,"ProjectedZ: "+ProjectedZ#()
Text 0,80,"EntityInView: "+EntityInView(cube,camera)
Flip
Wend
End
|
Просто устанавливаем Rectу Х = ProjectedX#(), У = ProjectedУ(), и длину сколько тебе надо и высоту.
-Как сделать чтобы появлялось 2 или 3 самалета. У мене получается что если ибиваешь одного то падают все .
|
КАкой-то у тебя косяк в типах. Если у тебя каждым самолет - тип, и отдельный объекет, такого не должно быть, посмотри чере зDebugLog сколько жизней к каждого самолета и сколько отнимается после попадания в одного из них.
|