|
|

楼主 |
发表于 2006-7-15 17:49:00
|
显示全部楼层
Re:Asphyre 3D问题?
DraculLin老大呀,
恩,好的,对了能不能说说Landscape呀?
刚刚看了自带的例子中的Skies例子
procedure TMainForm.DeviceInitialize(Sender: TObject; var Success: Boolean);
begin
// add default materials
Materials.Add();
Materials.Add();
Materials[1].Diffuse:= $FF294851;
Materials[1].Specular:= $FF404040;
Materials.Add();
Materials[2].Specular:= 0;
// primary terrain texture
Success:= Textures.AddTexture('terrain0.jpeg', Archive, aqHigh, alNone);
// secondary terrain texture
if (Success) then
Success:= Textures.AddTexture('terrain1.jpeg', Archive, aqHigh, alNone);
// sky texture
if (Success) then
Success:= Textures.AddTexture('sky.jpeg', Archive, aqHigh, alNone);
// load landscape height map
if (Success) then
Success:= CreateLandPlane();
// load the sky-dome
if (Success) then
Success:= LoadSkydome();
end;
//---------------------------------------------------------------------------
function TMainForm.CreateLandPlane(): Boolean;
var
Model: TAsphyreModel;
begin
// step 1. configure landscape textures
Landscape.Textures[0]:= TileTex(Point2(1.0, 1.0), Point2(0.0, 0.0));//到底是干什么的?用处是什么??
Landscape.InsertTexture();//插入的是什么纹理??
Landscape.Textures[1]:= TileTex(Point2(32.0,32.0), Point2(0.0, 0.0));
// step 2. update the landscape and create compatible mesh
Landscape.UpdateHeights();//干什么用的??
Landscape.UpdateMesh();//干什么用的??
// step 3. load a new model from the landscape mesh
Model:= Models.Add();
// -> specify what textures we're going to use
Model.Texturing.Include(0);
Model.Texturing.Include(1);
// -> actually *load* the mesh at this point
Result:= Model.LoadFromMesh(Landscape.Mesh);
// -> landscape is not illuminated
Model.Lighting:= False;
end;
//---------------------------------------------------------------------------
function TMainForm.LoadSkydome(): Boolean;
var
Sky: TAsphyreModel;
begin
Sky:= Models.Add();
Sky.Texturing.Include(2);
Result:= Sky.LoadFromASDb('skymap.mesh', Archive);
// skymap is not illuminated either
Sky.Lighting:= False;
end;
不是太理解
|
|