Вторник, 16 Апреля 2024, 21:46

Приветствую Вас Гость

[ Новые сообщения · Игроделы · Правила · Поиск ]
  • Страница 1 из 1
  • 1
Форум игроделов » Программирование » Basic » Как соединить листинги? Blitz Basic3d (Blitz Basic3d)
Как соединить листинги? Blitz Basic3d
sanya9411Дата: Среда, 26 Октября 2011, 20:47 | Сообщение # 1
частый гость
Сейчас нет на сайте
;*****************************************;создаём окно в 3d мир
Graphics3D 640,480,32,2
;выбираем буфер прорисовки
SetBuffer BackBuffer()
;создаём камеру
cam=CreateCamera()
;размещаем камеру
PositionEntity cam,1,1,1
;создаём источник света
light=CreateLight()
AmbientLight 200,200,200
;размещаем его
RotateEntity light,90,0,0
PositionEntity light, 1,20,1
;создадим остров
terrain=LoadTerrain( "остров1.bmp" )
;установим детальность ландшафта
TerrainDetail terrain,4000,True

;увеличим ландшафт
ScaleEntity terrain,1,50,1

;применим текстуры к нашему ландшафту
grass_tex=LoadTexture( "остров.bmp" )
ScaleTexture grass_tex, 250, 250
EntityTexture terrain,grass_tex,0,1
detail=LoadTexture( "clip_image003.jpg" )
EntityTexture terrain,detail,0,1
EntityTexture terrain,grass_tex,0,2
ScaleTexture detail, 2,2
;создадим море
Global watermesh=LoadMesh("20x20mesh.3ds")
RotateMesh watermesh,90,0,0
RotateEntity watermesh,-90,0,0
ScaleEntity watermesh,15,15,15
PositionEntity watermesh, 0,6,0

watertexture=LoadAnimTexture("wateranim.jpg",256,124,124,0,25)
EntityTexture watermesh,watertexture,0,1
ScaleTexture watertexture,.005,.005
EntityShininess watermesh,0.5
EntityAlpha watermesh, 0.5
EntityFX watermesh, 32
;--------------------
Global waterflow# = 10
Global wavesize# = 0.06

Global surface=GetSurface(watermesh,1)

Global VertexCount=CountVertices(surface)

Type Vertices
Field x#
Field y#
Field z#
End Type

Dim Vertex.Vertices(VertexCount)

For A=0 To VertexCount-1
Vertex(a) = New Vertices
Vertex(a)\x#=VertexX#(surface,a)
Vertex(a)\y#=VertexY#(surface,a)
Vertex(a)\z#=VertexZ#(surface,a)
Next

While Not KeyDown( 1 )
;задаём параметры перемещения камеры по ландшафту
If KeyDown( 205 )=True Then TurnEntity cam,0,-1,0
If KeyDown( 203 )=True Then TurnEntity cam,0,1,0
If KeyDown( 208 )=True Then MoveEntity cam,0,0,-1
If KeyDown( 200 )=True Then MoveEntity cam,0,0,1

x#=EntityX(cam)
y#=EntityY(cam)
z#=EntityZ(cam)

terra_y#=TerrainY(terrain,x#,y#,z#)+3

PositionEntity cam,x#,terra_y#,z#
wd=wd+1
If wd=4
EntityTexture watermesh,watertexture,frame,2
frame=frame+1
If frame=22 Then frame=0
wd=0
EndIf

UpdateWater()
;"Оживляем" все сущности в нашем 3d мире
UpdateWorld
RenderWorld

Text 80,0,"Д Л Я П Е Р Е М Е Щ Е Н И Я И С П О Л Ь З У Й Т Е С Т Р Е Л О Ч К И Н А К Л А В И А Т У Р Е"
Flip
Wend
End
raphics3D 640,480,16,2
SetBuffer BackBuffer()

Global a=150 ;iden. +r +g +b
Global inc=-1 ;iden. a++ or a--
Global r=0 ;red
Global g=0 ;green
Global b=55 ;blue

time=MilliSecs() ;timer
cam=CreateCamera() ;camera
l=CreateLight() ;Light

;----------------------------

;********** Telo progi ******************
Repeat

tim=MilliSecs()-time ;Timer 2

;-----------Update color---------------
If tim/100>1 Then
CameraClsColor cam, r+a, g+a, b+a
AmbientLight r+a, g+a, b-55+a
time=MilliSecs():tim=0
a=a-inc
If a=180 Or a=0 Then inc=inc*(-1)
EndIf
;--------------------------------------

RenderWorld
Text 0, 0, "Vremya: "+tim+" 'A' position "+a
Flip

Until KeyHit(1)
End
;*****************************************
Как это сделать?
Форум игроделов » Программирование » Basic » Как соединить листинги? Blitz Basic3d (Blitz Basic3d)
  • Страница 1 из 1
  • 1
Поиск:

Все права сохранены. GcUp.ru © 2008-2024 Рейтинг