4.2.2 シンプル チュートリアル 2: メッシュの追加


シンプル チュートリアル 2: メッシュの追加

This tutorial continues on the Simple Tutorial (see section Simple Tutorial 1: Basic Setup, World Creation). In this tutorial we explain a bit about VFS, texture management, and how you can add a simple mesh to the room.

このチュートリアルは、シンプルチュートリアルの続きです(4.2.1 シンプル チュートリアル 1: セットアップ基礎、ワールド作成をご覧下さい)。このチュートリアルでは、VFS、テクスチャマネージャ、ルームへのメッシュの追加方法について少し説明します。

This tutorial features (in addition to what is explained in simple1 tutorial):

このチュートリアルの特徴です(シンプル チュートリアル1での説明に付け加えて):

  • Loading a 3D sprite mesh factory using iLoader::LoadMeshObjectFactory?().
  • Creating a 3D sprite mesh object using iEngine::CreateMeshWrapper?().
  • Using the mesh state interfaces to change mesh factory and object attributes.
  • Putting the mesh at some position in the world using iMeshWrapper?::GetMovable?().
  • iLoader::LoadMeshObjectFactory?()を使用しての、3Dスプライトメッシュファクトリの読み込み
  • iEngine::CreateMeshWrapper?()を使用しての、3Dスプライトメッシュオブジェクトの作成
  • メッシュファクトリと、オブジェクト属性の変更のための、メッシュステイトインターフェイスの使用
  • iMeshWrapper?::GetMovable?()を使用して、ワールド内のいくつかの位置にメッシュを配置する

Basic setup of a Crystal Space application using csApplicationFramework?. Crystal Space has the concept of mesh factories and meshes. A mesh is basically some kind of 3D object. Crystal Space supports several kinds of meshes. In the previous tutorial we used the thing mesh to create the geometry of our room. In this tutorial we will use the 3D sprite mesh. A mesh factory is like a blue-print for a mesh (or sprite). It defines how the mesh looks and how it animates. Before you can use a mesh you need to have a mesh factory. Once you have a mesh factory you can create multiple meshes from this. See section Mesh Object Plug-In System.

基本は、csApplicationFramework?を使用してのCrystal Space アプリケーションのセットアップです。Crystal Spaceには、メッシュファクトリとメッシュの概念があります。メッシュは、基本的ないくつかの種類の3Dオブジェクトです。Crystal Spaceはさまざまな種類のメッシュをサポートします。1つ前のチュートリアルでは、ルームの形状を作成するために、thing meshを使用しました。このチュートリアルでは、3Dスプライトメッシュを使用します。メッシュファクトリは、メッシュ(またはスプライト)の教科書のようなものです。メッシュがどのように見えるのかと、どのようにアニメートするかを定義します。あなたがメッシュを使用する前に、あなたはメッシュファクトリを持つ必要があります。一度メッシュファクトリを持てば、メッシュファクトリを使用して複数のメッシュを作ることができます。Mesh Object Plug-In System?をご覧下さい。

In this example we are going to load a mesh factory from disk. If you have the standard Crystal Space distribution then you have the file `CS/data/standard.zip'. In that archive file there is a file called `sprite1' which contains the definition of our mesh factory. If you would like to examine the raw sprite data, extract it (by using, for instance, the command `unzip -x standard.zip sprite1') and look at how mesh factories for 3D sprites are defined (mesh factories for other types of meshes may appear different).

この例では、磁気ディスクからメッシュファクトリを読み込みます。もしあなたが基本の Crystal Space配布物を持っているのであれば、`CS/data/standard.zip`ファイルを持っています。このアーカイブファイルの中に、`sprite1`というファイルがあります。`sprite1`はメッシュファクトリの定義が含まれています。もし、列スプライトデータを調べたいのであれば、`CS/data/standard.zip`を解凍して下さい。(例えば、コマンド`unzip -x standard.zip sprite1`を使用して)そして、3Dスプライトのためのメッシュファクトリがどのように定義されるか見て下さい(他のタイプのメッシュのメッシュファクトリは、違って見えるかもしれません)。

But, how are we actually going to get that file out of that ZIP archive from within the Simple application? This is in fact very easy because Crystal Space supports the concept of VFS. Take a look at the VFS documentation (see section Virtual File System (VFS)) to learn how it works. Suffice it to say that `standard.zip' is an archive that is, by default, mounted onto the VFS path `/lib/std'. You can see all the mounted VFS paths in the `CS/vfs.cfg' file (and you can add more). So, this means that our sprite file can be found at the path `/lib/std/sprite1'.

しかし、どのようにして、シンプルアプリケーション内で、ZIPアーカイブからそのファイルを取り出せばよいのでしょうか?それは、とても簡単です。なぜなら、Crystal SpaceはVFSの概念をサポートしているからです。VFSの仕組みを学ぶために、VFSドキュメントを見てください(see section Virtual File System(VFS))。デフォルトとして、VFSのパス`lib/std`をマウントしているアーカイブが`standard.zip`であることを伝えれば十分です。あなたは、`CS/vfs.cfg`で、マウントしているすべてのVFSパスを確認することができます(また、追加することができます)。そしてこのことは、スプライトファイルは、`/lib/std/sprite1`のパスから見つけることができることを意味します。

If you look at the `sprite1' file you can see that it refers to a material named `spark'. So, we'll have to load that material as well. This can also be found in `standard.zip' at the path `/lib/std/spark.png'.

`sprite1`ファイルを見ると、`spark`という名前の構成要素を参照しています。なので、私たちはこの構成要素も読み込む必要があります。これは、`standard.zip`の`/lib/std/spark.png`の中にあります。

4.2.2.1 Loading a Material in Memory
4.2.2.2 Loading a Mesh Factory in Memory
4.2.2.3 Creating a Mesh from a Factory

4.2.2.1 メモリ上への構成要素の読み込み
4.2.2.2 メモリ上へのメッシュファクトリの読み込み
4.2.2.3 ファクトリからのメッシュの作成

最新の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
  • 4.2.2 シンプル チュートリアル 2: メッシュの追加
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

今日の11件

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