StrataCafe-Forums/その5 位置の操作

Last-modified: 2008-09-15 (月) 17:13:32

quote:
引用:
Originally posted by johnsonua
もとは、johnsonuaによって記入されました。

The 'Follow the leader' script that comes with 5.0 has the line:
5.0に付属する「リーダーに続く」スクリプトはラインを持っています:

return position + leaderFunc(time)
位置+leaderFunc(時間)を返します。

Is there a way to add an offset to 'position'?
そこで「位置する」オフセットを加える方法である?

Clearly you can add positions, since that line above is really doing (in pseudocode):
明白に、その上記のラインが実際に行っている(偽コードの中で)ので、位置を加えることができます:

return position + leader.position(time)
位置+leader.position(時間)を返します。

What I want to do is:
私が行いたいのは次のとおりです:

return position + leader.position(time) + (deltaX, deltaY, deltaZ)
位置+leader.position(時間)+(deltaX、deltaY、deltaZ)を返します。

Ie: follow the leader plus some offset.
つまり:あるオフセットとリーダーに従ってください。

How?
どのように?

Also, is there anywhere where we can just get a listing of the s3d.* objects?
さらに、そこでどんな場所でも私たちがs3dのリストをちょうど得ることができる場所である。*オブジェクト?

Yes, it's very easy to add an offset. All you need to do is add an additional Point3d vector to the return value.
はい、オフセットを加えるのは非常に簡単です。する必要のあるのは返り値に付加的なPoint3dベクトルを加えることです。

Here's an example:
ここに、例があります:

First, the initialization script:

  • We'll communicate via a global "whiteboard".
  • Ensure that it exists.

s3d.whiteboard = s3d.whiteboard or {}
s3d.whiteboard.follow_the_leader = s3d.whiteboard.follow_the_leader or {}

  • Our shared leader name.
    local leaderName = "Sam"
  • A random offset vector
    local dx = math.random(72)
    local dy = math.random(72)
    local dz = math.random(72)
    local offset = s3d.vec.Point3d(dx, dy, dz)

1位、初期化スクリプト:--私たちはグローバルな「白板」によって通信するでしょう。-- それが存在することを確認してください。s3d.whiteboard=s3d.whiteboardあるいは{}s3d.whiteboard.follow_the_leader=s3d.whiteboard.follow_the_leaderか、{}-- 私たちの共有されるリーダー名。ローカルのleaderName=、「サム」-- 任意のオフセット・ベクトルローカルのdx=math.random(72)ローカルのdy=math.random(72)ローカルのdz=math.random(72)ローカルのオフセット=s3d.vec.Point3d(dx、dy、dz)
And finally the source (runtime) script:

  • Access our leader keyframed value function under its hash key

local leaderFunc = s3d.whiteboard.follow_the_leader[leaderName]
if leaderFunc then

   return position : Add( leaderFunc(time) ): Add( offset )

else

   return position

end

そして最後に、出所(ランタイム)スクリプト:--私たちのリーダーにアクセスする、そのハッシュ・キーの下の価値関数をkeyframedした。その後、leaderFuncが位置を返す場合、ローカルのleaderFunc=s3d.whiteboard.follow_the_leader[leaderName:]:次のように付け加えてください(leaderFunc(時間)):ほかに加えます(オフセット)。位置を返します。終了
There is nothing publically available yet for a printed or text listing of the available methods in the s3d table.
publicallyに利用可能なものは何もまだありません、のために、1つの、印刷された、あるいはs3dテーブル中の利用可能な方法をリストするテキスト。
If you create a new Script FX shader or a new node script, you'll notice the "Globals" menu on the lower left corder of the window. By scrolling down the s3d table you'll be able to find all of the available methods.
新しいスクリプトFX遮光物あるいは新しいノード・スクリプトを作成すれば、ウィンドウのより低い左ひもを縫う人の上の「Globals」メニューに気づくでしょう。s3dテーブルを下へスクロールすることによって、利用可能な方法をすべて見つけることができるでしょう。

Please note that although you can see this, most of these methods are bound to C++ functions. They require certain datatypes or require a return value to be passed to the function. Although you can see this information, it really does not help much until full documentation is available.
あなたはこれを見ることができるが、ほとんどのこれらの方法がC++機能に結び付けられることに注意してください。それらはあるデータ・タイプを要求するか、あるいは機能に渡されることを返り値に要求します。あなたはこの情報を見ることができますが、十分なドキュメンテーションが利用可能であるまで、それは実際にあまり支援しません。

You can use the following snippet to recursively print out the contents of one of the table elements in s3d, say s3d.math:
再帰的にs3d、発言権s3d.mathの中のテーブル要素のうちの1つの内容を印刷するために次の断片を使用することができます:
for k, v in pairs (s3d.math) do

   --  print the key,value pair
   print ("key = ", k, " value = ", v)
   --  add a newline to make it cleaner
   print("")

end

ペア(s3d.math)中のkおよびvのために、それをより清潔な印刷("")にするためにnewlineを加える(キー(値ペア印刷(「キー=「k、"値=「v))を印刷する)。終了
Also note that there is a line limit to the Console, so trying to print larger tables (such as s3d.vec) will not capture all of the information.
さらにコンソールのライン制限があることに注意してください。したがって、より大きなテーブル(s3d.vecの?謔、な)を印刷しようとすることが情報のすべてを捕らえるとは限らないでしょう。

Jon Bradley

Ok, I see, so 'position' is a instance of an sd3.vec.Point3d
OkとIは見ます。したがって、「位置」はsd3.vec.Point3dの実例です。

quote:
引用:
First, the initialization script:
1位、初期化スクリプト:

  • Our shared leader name.
  • 私たちの共有されるリーダー名。
    local leaderName = "Sam"
    ローカルのleaderName=、「サム」
  • A random offset vector
  • 任意のオフセット・ベクトル
    local dx = math.random(72)
    ローカルのdx=math.random(72)
    local dy = math.random(72)
    ローカルのdy=math.random(72)
    local dz = math.random(72)
    ローカルのdz=math.random(72)
    local offset = s3d.vec.Point3d(dx, dy, dz)
    ローカルのオフセット=s3d.vec.Point3d(dx、dy、dz)

If I wanted this to change each keyframe, I would move
もし各キーフレームを変更するこれがほしければ、私は移動するでしょう。

local offset = s3d.vec.Point3d(dx, dy, dz)
ローカルのオフセット=s3d.vec.Point3d(dx、dy、dz)

To the actual script part, right?
ちょうど実際のスクリプト部品に?

I'm kind of grinding my way towards a rudimentary pseudo-flocking script, and would combine your multiple copy script with the Follow the Leader; I'm looking at varying the positions of each member of the 'flock' somewhat randomly to get away from the rigid path followed by 'Follow the Leader'
私は、まあ基本的な偽集まるスクリプトへの方法を挽いており、Followとあなたの複合のコピー・スクリ?vトを組み合わせましょう、リーダー;私は、後続する厳密なパスから逃げるために「群」の各メンバーの位置を多少任意に変えることが、「リーダーに続く」のを見ています。

A question for later is collision detection. Will I have to roll my own or is the collision detection built into Strata (for particle effects and such) exposed in scripting?
質問は後のために衝突検出です。Iは私のものを回転しなければならないでしょうか。それとも、衝突検出はスクリプトを書くことで露出した層(粒子結果およびそのようなもの用の)に組み込まれますか。

  • There's nothing like convincing people to open random excutable attachments to keep your job safe.
    あなたの仕事を安全にしておく任意のexcutableな付属物を開くように人々に説得することのようなものは、何もありません。

Bruce Johnson

Hi,
やあ、

I didn't want to start a new thread with my question as it is closely connected to these pre-defined sripts.
それがあらかじめ定義されたsriptsに緊密に接続されるとともに、Iは質問で新しい糸を始めたくありませんでした。

I tried to write a script that would make a wheel or a ball roll on the floor. Therefore I would have to manipulate its position and its rotation angle by using the perimeter and the distance travelled in time. It would be necessary to return both, position and rotation. However the scripts in the object properties only return the corresponding value of the attribute. Is it possible to change more than one attribute in the object properties ?
Iは、床の車輪あるいはボール回転を作るスクリプトを書こうとしました。したがって、Iは、そのうちに旅慣れた周囲と距離の使用により、その位置とその回転角を操作しなければならないでしょう。両方、位置および回転を返すことが必要でしょう。しかしながら、オブジェクト特性中のスクリプトは、単に属性の対応する値を返します。オブジェクト特性中の1つを超える属性を変更することは可能ですか。

  • Benny (Bernd Gutmann)

quote:
引用:
If I wanted this to change each keyframe, I would move
もしIが各キーフレームを変更するこれがほしければ、Iは移動するでしょう。

local offset = s3d.vec.Point3d(dx, dy, dz)
ローカルのオフセット=s3d.vec.Point3d(dx、dy、dz)

To the actual script part, right?
ちょうど実際のスクリプト部品に?

I'm kind of grinding my way towards a rudimentary pseudo-flocking script, and would combine your multiple copy script with the Follow the Leader; I'm looking at varying the positions of each member of the 'flock' somewhat randomly to get away from the rigid path followed by 'Follow the Leader'
私は、まあ基本的な偽集まるスクリプトへの方法を挽いており、Followとあなたの複合のコピー・スクリ?vトを組み合わせましょう、リーダー;私は、後続する厳密なパスから逃げるために「群」の各メンバーの位置を多少任意に変えることが、「リーダーに続く」のを見ています。

A question for later is collision detection. Will I have to roll my own or is the collision detection built into Strata (for particle effects and such) exposed in scripting?
質問は後のために衝突検出です。Iは私のものを回転しなければならないでしょうか。それとも、衝突検出はスクリプトを書くことで露出した層(粒子結果およびそのようなもの用の)に組み込まれますか。

As far as moving the Point3d definition to the source script, yes, that's how you could do it. Note that in the example I provided it's just returning a random number, so your object will jump all over the place. You'd need a smooth time-step based method of calculating the offset so that it doesn't jump. Do a google search on that.
どのようにそれをすることができたかである出所スクリプト(はい)へのPoint3d定義を移動させることまで。Iが提供した例において、それが乱数をちょうど返していることに注意してください。したがって、あなたの目的は至る所にジャンプ?キるでしょう。それがジャンプしないようにオフセットを計算する、滑らかな時間ステップ基づいた方法を必要とするでしょう。その上のgoogle探索を行ってください。

On the flocking, I've got some examples lying around here of flocking that I'll post up at some point. I'm working on some more elaborate AI stuff that will hopefully find it's way into a script pack that can be purchased at some point. Right now, there's a lot of work into something like that because you have to create your own classes to handle spline-based animation outside of the main Strata code. That means writing a bezier or cubic spline interpolation class.
毛屑においては、私が、いくつかの例に毛屑をこのあたりに位置させました、私は、あるポイントで記入しましょう。私は、あるポイントで購入することができるのがスクリプト・パックへの方法であるとうまくいけば分かるあるより精巧なAI材料に取り組んでいます。今ちょうど、あなたが主な層コードに外部のスプラインに基づいたアニメーションを扱うために自分のクラスを作成しなければならないので、そのようなものの中への多くの仕事があります。それはbezierか立方体のスプライン書き入れクラスを書くことを意味します。

The aim-at functionality is pretty straightfoward though by calculating directional vectors based on the movement of the object - the mathematics can be looked up on google.
その、機能性目標で、オブジェクトの移動に基づいた方向のあるベクトルの計算によってだがきれいなstraightfowardである-数学は上に見上げることができます、グーグリになります。

As far as collision is concerned, there are some constructors available to create a CollisionInfo object which contains a variety of properties, and some ways of checking when collision occurs during rendering through the Script FX system. I don't believe we explored these aspects much prior to release of CX 5. I'll have to get back to you on this one with a definitive answer.
衝突に関する限り、様々な特性を含んでいるCollisionInfoオブジェクトを作成することができる何人かの建設者、およびスクリプトFXシステムによって与える間に、衝突がいつ生じるかチェックするいくつかの方法がいます。Iは、CX 5のリリースに先立って私たちがこれらの様相を非常に調査したと信じません。私は決定的な答えを備えたこの一つの上であなたに戻らなければならないでしょう。

cheers.
喝采。

Jon Bradley

quote:
引用:
Originally posted by Antaguar
もとは、Antaguarによって記入されました。

Hi,
やあ、

I didn't want to start a new thread with my question as it is closely connected to these pre-defined sripts.
それがあらかじめ定義されたsriptsに緊密に接続されるとともに、Iは質問で新しい糸を始めたくありませんでした。

I tried to write a script that would make a wheel or a ball roll on the floor. Therefore I would have to manipulate its position and its rotation angle by using the perimeter and the distance travelled in time. It would be necessary to return both, position and rotation. However the scripts in the object properties only return the corresponding value of the attribute. Is it possible to change more than one attribute in the object properties ?
Iは、床の車輪あるいはボール回転を作るスクリプトを書こうとしました。したがって、Iは、そのうちに旅慣れた周囲と距離の使用により、その位置とその回転角を操作しなければならないでしょう。両方、位置および回転を返すことが必要でしょう。しかしながら、オブジェクト特性中のスクリプトは、単に属性の対応する値を返します。オブジェクト特性中の1つを超える属性を変更することは可能ですか。

You will need to share both properties so that each node script will be able to use the other in calculation of it's values. You're going to have a really fun time with this one mathematically because it's a 3-dimensional movement, not a 2d system. Rememer that rotation has 3 separate elements to it (Euler) - or in the case of a Quaternion, 4.
ノード・スクリプトがそれぞれ計算の中で他方を使用することができるように、両方の特性を共有する必要があるでしょう、それは値です。それが2dシステムではなく3-次元の移動であるので、これを備えた実際に楽しい時を数学上過ごすでしょう。回転が持っているRememer、それへの3つの別個の要素(オイラー)-あるいは四元数、4の場合には。

The way the node script system works is by adding a scripting attribute (node) to each of these properties of the object. There's not a single unified method of doing this right now. We don't have a single script execution source that can change all possible properties of the object at once. This is less efficient than scripting only what needs to be scripted, because of the way the script evaluation in Lua works. This is definitely something for a feature request.
その方法、ノード・スクリプト・システム作業、オブジェクトのこれらの特性の各々にスクリプトを書く属性(ノード)を?チえることによりあります。今ちょうどこれをする単一の一体になった方法はありません。私たちは、直ちにオブジェクトのあらゆる特性を変更することができる単一のスクリプト実行出所をしていません。これはLuaの中のスクリプト評価が働く方法のために台本通りである必要があるものだけをスクリプトにするほど効率的ではありません。これは明確に特徴リクエスト用の何かです。

If you check out the follow the leader scripts, you can see how it is able to share data across node scripts (or to other objects) by storing a variable in some global table that all objects can access. You can add two properties to this - say sphere1Rotate, sphere1Position, and then use these to make your calculations.
followをチェックする場合、リーダー・スクリプト、オブジェクトがすべてアクセスすることができるあるグローバルなテーブルに変数を格納することにより、ノード・スクリプト(あるいは他のオブジェクトに)を横切ってそれがどのようにデータを共有することができるか分かります。これに2つの特性を加えることができます。sphere1Rotate(sphere1Position)を言い、次に、あなたの計算を行うためにこれらを使用します。

Jon Bradley