4.2.2.2 メモリ上へのメッシュファクトリの読み込み


4.2.2.2 メモリ上へのメッシュファクトリの読み込み

Now that we have our material we can use it to load the mesh factory. Edit `simple.cpp' and add the following code in Simple::CreateSprites?() (before the end and after the code we just added to load the material):

今、メッシュファクトリを読み込むために使用する構成要素を持っています。`simple.cpp`を編集し、次のコードをSimple::CreateSprites?()に追加して下さい(終了の前で、かつ、構成要素を読み込むためについ先程追加したコードの後に)。

void Simple::CreateSprites ()
{
 ...
 // Load a sprite template from disk.
 csRef<iMeshFactoryWrapper> imeshfact (loader->LoadMeshObjectFactory (
       "/lib/std/sprite1"));
 if (imeshfact == 0)
   ReportError("Error loading mesh object factory!");
}

This example uses iLoader::LoadMeshObjectFactory?() to load the mesh factory from the given location. The name of the mesh factory will be "box" as that is the name given in the file `sprite1' itself.

この例は、与えられた場所からメッシュファクトリを読み込むために、iLoader::LoadMeshObjectFactor?()を使用します。メッシュファクトリの名前は、`sprite1`ファイルの中で与えられた名前である"box"となるでしょう。

This is all there is to it. After this call the mesh factory is loaded in the engine and can be used to create meshes. This is what we'll do in the next section.

これが、メッシュファクトリを読み込むすべてです。これを呼んだ後は、メッシュファクトリはエンジン内にロードされ、メッシュを作成するために使用されます。このことは、次の章で説明します。

最新の20件

2007-02-18 2007-02-12 2007-01-31 2007-02-12 2007-01-14 2007-01-21 2007-02-12 2007-02-11 2007-01-15 2007-01-14 2007-02-12 2007-02-11 2007-02-01 2007-01-21 2007-01-19 2007-02-12 2007-01-19 2009-08-27 2007-01-10

今日の8件

  • counter: 102
  • today: 1
  • yesterday: 0
  • online: 1