кодим-кодим
Для практики: закомментируем команду текстурирования террайна и посмотрим на выполнение:
Graphics3D 800,600,32
SetBuffer BackBuffer()
Function create_user(x#=0,y#=1,z#=0)
user=CreateSphere()
camera=CreateCamera(user)
PositionEntity camera,0,1,-0.5
PositionEntity user,x#,y#,z#
End Function
Function create_world()
terrain=CreatePlane()
tertex=LoadTexture("terrain1.jpg")
;EntityTexture terrain,tertex
FreeTexture tertex
create_user()
End Function
create_world()
While Not KeyHit(1)=1
RenderWorld()
Flip
Wend
End
Как я и обещал, видим светлый прямоугольник отхапавший часть экрана. :grins Раскомментируем строчку обратно.
Кстати о комментариях: не стоит ими пренебрегать но и объяснять всё подряд не стоит. :o
;инициализация графики
Graphics3D 800,600,32
SetBuffer BackBuffer()
;создание игрока
Function create_user(x#=0,y#=1,z#=0)
user=CreateSphere()
camera=CreateCamera(user)
PositionEntity camera,0,1,-0.5
PositionEntity user,x#,y#,z#
End Function
;создание игрового мира
Function create_world()
terrain=CreatePlane()
tertex=LoadTexture("terrain1.jpg")
EntityTexture terrain,tertex
FreeTexture tertex
create_user()
End Function
;функции закончились :)
;--------------------------------
create_world()
;MAIN LOOP
While Not KeyHit(1)=1
RenderWorld()
Flip
Wend
;----------------------------
End
Надеюсь, вы уже обучили Блитц понимать русский язык?
Только по секрету:
http://community.boolean.name/index.php?act=ST&f=4&t=25
Не стоит так же пренебрегать грамотным форматированием кода:
;инициализация графики
Graphics3D 800,600,32
SetBuffer BackBuffer()
;создание игрока
Function create_user(x#=0,y#=1,z#=0)
user=CreateSphere()
camera=CreateCamera(user)
PositionEntity camera,0,1,-0.5
PositionEntity user,x#,y#,z#
End Function
;создание игрового мира
Function create_world()
terrain=CreatePlane()
tertex=LoadTexture("terrain1.jpg")
EntityTexture terrain,tertex
FreeTexture tertex
create_user()
End Function
;функции закончились :)
;--------------------------------
create_world()
;MAIN LOOP
While Not KeyHit(1)=1
RenderWorld()
Flip
Wend
;----------------------------
End
Вот…