比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

In the previous section you already created some agents. In Atoms there are a couple of layout modules you can use to layout your agents in the scene.

Grid layout

The grid layout creates a grid of agents.

Create an agent group. Add a gridLayout module. From the grid layout modules parameters tab, type the agent type name you entered previously in the "agentType" field (i.e. testRobot). and set the "size" field to (3,1,3). Then add a stateMachine module. From the "Draw attribute" tab change the draw mode from skeleton to skin.

Click on the time slider rewind button or on the updateSim shelf button and your 9 agents will appear in the viewport.
Hit the play button to run the simulation.

Image Removed

Points layout

With the points layout you can choose the exact location where the agents must be created or you can use the input points a geo node.

Agents Layout tool

Create an agent group. Add a pointsLayout module. Then add a stateMachine module. From the "Draw attribute" tab change the draw mode from skeleton to skin.
Rewind.

Go inside the "Modules Attribute" and "pointsLayout" tab in the property editor, then click on "Agent Layout Tool" button  or press Return while the agent group node is selected (alternatively you can open the layout tool from the Atoms menu: Atoms->Tool->Agents Layout Tool). Press P to open the agents layout tool widget. Press S or click on the Image Removed icon, move the mouse over the viewport. A green arrow indicates where you are going to create an agent and its direction. Press the LMB to create an agent. To change direction press CTRL+LMB and drag the cursor to the left/right. You can create multiple agents at once by pressing the Image Removed icon.

After creating some agents you can still edit their position, direction and change their agent type. Press the Q button or use the Image Removed icon, select some agents. Then press the A button or the Image Removed icon and use the move manipulator to move the agents in the scene. To rotate the use the Z button or the Image Removed icon.

From the tool UI you have access to more action for each different mode. For example, go back to the selection mode and from the UI press "delete agents" to delete them. An option for changing the agent type is also available.

Image RemovedImage Removed

Image Removed

Using input points

If you connect a geo node to the agentGroup node, the points layout module will use the input points of the incoming mesh to generate agents. You can control the agent direction and agent type adding the atoms_pointsLayout_direction and atoms_pointsLayout_agentType point attributes. You can pass also the agent group ids using the atoms_pointsLayout_ids point attribute.

Create and agent group. Add a points layout module and a state machine module. Add a grid as input of the agentGroup1 node and set grid size to 1000. Now add an "attribute Create" node between the grid and the agentGroup1 node. Inside the attribute create node set the name to atoms_pointsLayout_directions and the type to vector. Now set the value to 1,0,1. Try experimenting a little by creating a scatter node after the grid1 object to randomly place the agents on the grid mesh.

Image Removed

Mesh scatter layout

The mesh scatter layout creates randomly agents on a input mesh.

Create a grid, and scale it to 150,1,150

Create an agent group and add a meshScatterLayout module and a stateMachine module.
Set the "radius" field to 50 and the iterations to 500. Set the mesh to grid. And set the matrix as in the image on the left. If you scaled the sop grid and not the obj grid you can leave the matrix at 1.

Click on time slider rewind button and your agents will appear in the viewport.
Hit the play button to run the simulation.

Image Removed

Curve layout

The curve layout creates agents along an input curve.

Create a curve, and scale it to 150,1,150

Create an agent group and add a curveLayout module and a stateMachine module.
Set the curve you created inside the "curve" attribute of the curveLayout module .

Click on time slider rewind button and your agents will appear in the viewport.
Hit the play button to run the simulation.

Image Removed

Stadium layout

The stadium layout creates an arena of agents.
Create an agent group, please make sure the attribute editor is visible and the agent group node is selected.
Click on the "Add" button and add a stadiumLayout module. Type the agent type name you entered previously in the "agentType" field (i.e. testRobot).
Set the "size" field to (500,500,100),the shapeType to 1 and the steps to 5. Click again on the "Add" button and add a stateMachine module.

Offset behaviour module

The offset behaviour module can be used to modify an existing behaviour, so can be used with the grid layout module or any other layout module. It is also supported by the "Agent Layout Tool".

  • Create an agent group
  • Attach a grid layout module and set the size attribute to (5,0,5)
  • Add a state machine module
  • Add an offset behaviour module
  • Select the agent group and activate the "Agent Layout Tool" from the Atoms menu Atoms → Tools → Agents Layout Tool
  • Press the Q button or use the Image Removed icon, select some agents
  • Press the A button or the Image Removed icon and use the move manipulator to move the agents in the scene. To rotate the use the Z button or the Image Removed icon.
  • Add an agent filter behaviour module
  • Open again the "Agent Layout Tool"
  • Select some agents
  • From the Agent layout tool ui press the Delete agents button
  • Rewind your scene and press play

    前のセクションで、既にいくつかのエージェントを作成しました。 Atomsには、シーン内でエージェントをレイアウトするために、使用できるLayoutモジュールがいくつかあります。


    Grid layout

    Grid Layoutはエージェントのグリッドを作成します。

    エージェントグループを作成します。GridLayoutモジュールを追加してください。

    Grid Layoutモジュールの「Parameters」タブで、以前に「AgentType」フィールドに入力したエージェントタイプの名前を入力します(つまりtestRobot)。

    そして「Size」フィールドを(3,1,3)に設定します。次に、StateMachineモジュールを追加します。「Draw Attribute」タブで、DrawモードをSkeletonからSkinに変更します。

    タイムスライダのRewindボタンまたはUpdateSimシェルフボタンをクリックすると、9つのエージェントがビューポートに表示されます。

    Playボタンを押してシミュレーションを実行します。

    Image Added


    Points layout

    Points Layoutでは、エージェントを作成する必要がある正確な場所を選択することも、入力ポイントをgeoノードとして使用することもできます。



    Agents Layout tool

    エージェントグループを作成します。

    PointsLayoutモジュールを追加してください。そして、StateMachineモジュールを追加します。「Draw Attribute」タブで、DrawモードをSkeletonからSkinに変更します。

    巻き戻します。


    プロパティエディタの「Modules Attribute」タブと「PointsLayout」タブをクリックし、「Agent Layout Tool」ボタンをクリックするか、またはAgent Groupノードを選択した状態でReturnキーを押します(AtomsメニューからLayout Toolを開くこともできます:Atoms > Tool > Agents Layout Tool)。


    Pを押して、Agent Layout Toolウィジェットを開きます。 Sを押すか、Image Addedアイコンをクリックして、マウスをビューポート上に移動します。

    緑色の矢印は、エージェントを作成する場所とその方向を示しています。

    エージェントを作成するには、LMBを押します。方向を変更する場合は、Ctrl + LMBを押しながらカーソルを左右にドラッグします。 Image Addedアイコンを押すと、一度に複数のエージェントを作成できます。


    いくつかのエージェントを作成した後も、それらの位置、方向、およびエージェントタイプを変更することができます。 Qボタンを押すか、Image Addedアイコンを使用して、エージェントを選択します。次に、AボタンまたはImage Addedアイコンを押して、moveマニピュレータを使用してシーン内のエージェントを移動します。回転させるには、ZボタンまたはImage Addedアイコンを使用します。


    ツールのUIから、ユーザーはそれぞれの異なるモード毎に、より多くのアクションにアクセスすることができます。例えば、Selectモードに戻り、UIから「Delete Agents」を押して、それらを削除します。エージェントタイプを変更するためのオプションもあります。

        


    Image AddedImage Added

    Image Added




    入力ポイントの使用

    geoノードをAgent Groupノードに接続すると、Points Layoutモジュールは入力メッシュの入力ポイントを使用して、エージェントを生成します。

    atoms_pointsLayout_directionおよびatoms_pointsLayout_agentType pointアトリビュートを追加して、エージェントの方向とエージェントの種類を制御できます。 atoms_pointsLayout_ids pointアトリビュートを使用してエージェントグループIDを渡すこともできます。


    エージェントグループを作成します。Points LayoutモジュールとState Machineモジュールを追加します。 agentGroup1ノードの入力としてグリッドを追加し、Grid Sizeを1000に設定します。次に、グリッドとagentGroup1ノードの間に「Attribute Create」ノードを追加します。Attribute Createノード内で、名前をatoms_pointsLayout_directionsに設定し、タイプをVectorに設定します。

    直ちに、Valueを1,0,1に設定します。エージェントをグリッドメッシュにランダムに配置するために、grid1オブジェクトの後にScatterノードを作成して、試行します。

    Image Added



    Mesh scatter layout

    Mesh Scatter Layoutは、入力メッシュ上にランダムにエージェントを作成します。
    グリッドを作成し、150、1、150にスケールします
    エージェントグループを作成し、MeshScatterLayoutモジュールとStateMachineモジュールを追加します。
    「Radius」フィールドを50に設定し、Iterationsを500に設定します。メッシュをgridに設定します。そして左の画像のように行列を設定します。 objグリッドではなくsopグリッドをスケールした場合は、matrixを1のままにします。


    タイムスライダのRewindボタンをクリックすると、エージェントがビューポートに表示されます。
    Playボタンを押してシミュレーションを実行します。

    Image Added


    Curve layout

    Curve layoutは、入力カーブに沿ってエージェントを作成します。
    カーブを作成し、それを150、1、150にスケールします。
    エージェントグループを作成し、CurveLayoutモジュールとStateMachineモジュールを追加します。
    作成したカーブをCurveLayoutモジュールの「Curve」アトリビュート内に設定します。


    タイムスライダのRewindボタンをクリックすると、エージェントがビューポートに表示されます。
    Playボタンを押してシミュレーションを実行します。

    Image Added


    Stadium layout

    Stadium Layoutは、エージェントの舞台を作ります。
    エージェントグループを作成します。アトリビュートエディタが表示され、Agent Groupノードが選択されていることを確認してください。
    「Add」ボタンをクリックして、StadiumLayoutモジュールを追加してください。


    以前に、「AgentType」フィールドに入力したエージェントタイプ名を入力します(つまりtestRobot)。
    「Size」フィールドを(500,500,100)に、ShapeTypeを1に、Stepsを5に設定します。

    「Add」ボタンを再度クリックして、StateMachineモジュールを追加します。




    Offset behaviourモジュール

    Offset Behaviourモジュールは、既存のbehaviourを変更するために使用することができるため、grid layoutモジュールまたは他のlayoutモジュールと共に使用できます。 「Agent Layout Tool」でもサポートされています。

    • エージェントグループを作成します。
    • Grid Layoutモジュールを添付し、Sizeアトリビュートを(5,0,5)に設定します。
    • State Machineモジュールを追加します。
    • Offset  Behaviourモジュールを追加します。
    • エージェントグループを選択し、AtomsメニューのAtoms > Tools > Agents Layout Toolから「Agent Layout Tool」を有効にします。
    • Qボタンを押すか、Image Addedアイコンを使用して、エージェントを選択してください。
    • AボタンまたはImage Addedアイコンを押し、moveマニピュレータを使用して、シーン内のエージェントを移動します。回転させる場合は、ZボタンかImage Addedアイコンを使用します。
    • Agent Filter Behaviourモジュールを追加します。
    • 「Agent Layout Tool」を再度展開します。
    • いくつかのエージェントを選択します。
    • Agent Layout ToolのUIから「Delete Agent」ボタンをクリックします。
    • シーンを巻き戻して、Playを押します。