Archive for the ‘unity’ Category

 

blender : python api, get world matrix

8月 12th, 2014

http://blender.stackexchange.com/questions/1283/how-to-get-world-space-matrix-of-any-pose-bone ぼーんのmatrix * id_data.matrix_worldだけでした! 基準boneを決めて、全体の高さを揃えるのが簡単に出来るようになりました。 bone.location の並びが x,z,yのようです。 設定で変えられるかも?

Read full article | コメントは受け付けていません。

blender : python で dopesheetを編集する。

8月 12th, 2014

bvhなどを利用する時にkeyframeを間引きしたりするのにスクリプトで一括操作してみます。 1. コマンドでblenderを起動 macの場合。 $ /Applications/Blender/blender.app/Contents/MacOS/blender 2. 編集するファイルを普通に開く 3. Scriptingに変更 4. pythonで書いて Run Scriptすると print()からterminalへ表示されます。 blender python api http://www.blender.org/documentation/blender_python_api_2_71_release/ 適当に触れるようになりました。 import bpy for action in bpy.data.actions: if action.name == “Reviving”: print(action.name) for channel in action.fcurves: print ( channel.data_path ) for i in range(0,11): for key in channel.keyframe_points: # key.select_control_point = False print(key.type) print(key.handle_left[0]) print(key.handle_left[1]) print(key.co[0]) […]

Read full article | コメントは受け付けていません。

unity | draw call batching

8月 10th, 2014

http://docs-jp.unity3d.com/Documentation/Manual/DrawCallBatching.html 同じ形で同じマテリアル・テクスチャの物を自動的にバッチング 同じオブジェクトを1000個置いてもdraw callは増えません。 2つのオブジェクトのテクスチャを一つにまとめて1つのマテリアルにするのも効果があるそうです。 なるほど。。。これは使える。 テクスチャアトラス。というそうです、後で試してみます。 ・staticチェックボックス staticバッチングというそうで、動かない物にはすべて適用して良いようです。 (Proのみだそうです。

Read full article | コメントは受け付けていません。

unity : スポットライト

8月 8th, 2014

スポットライトが初回当たるときにiOSでカクつくのではずしました。 shader( color, specular )を使わない。 textureをいろいろ変更してみてみたりしたけど、どうしても初回だけ一瞬カクっとなるのでスポットライトは使わないことにしました。

Read full article | コメントは受け付けていません。

unity : shadow distance from camera

8月 6th, 2014

edit > project setting > quality quality settings で変更可能 iOS, androidはSimpleが適用されているので、Simpleの値を変更 [http://docs.unity3d.com/Manual/class-QualitySettings.html] Shadow Distance The maximum distance from camera at which shadows will be visible. Shadows that fall beyond this distance will not be rendered. http://docs.unity3d.com/Manual/Shadows.html 遠くの影は見えても意味ないので。と書いてあります。

Read full article | コメントは受け付けていません。

unity : カメラの向きとコントローラーの向きからプレイヤーの回転を

8月 6th, 2014

2ベクトルの角度を計算して、足しました。 Vector3.Angle で角度を取得して Vector3.Cross 外積でどちら向きか取得してみました。 float forwardAngle = Vector3.Angle (player.forward, controlDirection); if (Vector3.Cross (player.forward, controlDirection).y < 0) { forwardAngle *= -1; } プレイヤーとカメラ向きとの角度と十字キーの入力角度(上を0度、右90みたいな)を足してプレイヤーの次の向きを指定。

Read full article | コメントは受け付けていません。

airplayで動画キャプチャ reflector , mac and ipod touch ( ios7.1.2

8月 3rd, 2014

macbook air( 2011 mid )とipod touchでゲームプレイ動画を撮ってみました。 http://www.airsquirrels.com/reflector/ 7days trial これを macにインストールして起動。 そのあと ipod touch で airplayをonにすると選択出来ます。 (reflector起動前だとairplayボタンが表示されません。 無線LANで同一ローカルネットワーク内である必要があります。 以下のようなプレイ画面(unity で作成中のゲーム)を撮りました。 タイトルと字幕はimovieで入れてみました。

Read full article | コメントは受け付けていません。

unity : ontriggerenterの親子関係

8月 3rd, 2014

A 親子関係のオブジェクト 親:collider + rigidbody + script 子:collider + script で第三物体に接触した時 onTriggerEnterが呼ばれます。 親は、親と子両方の接触で呼ばれます。 子は、子の接触の時呼ばれます。 B 親子関係のオブジェクト 親:collider + rigidbody + script 子:collider + rigidbody + script で第三物体に接触した時 onTriggerEnterが呼ばれます。 親は、親の接触だけ呼ばれます。 子は、子の接触だけ呼ばれます。 でした。

Read full article | コメントは受け付けていません。

unity : audio

8月 3rd, 2014

http://docs-jp.unity3d.com/Documentation/Manual/AudioFiles.html とりあえずファイルサイズとメモリにロードしておくかどうかをチェックしました。 長さや音量等の調整はaudacityで編集しました。 Hardware Decoding これはチェックしたときのデメリットは何かあるのでしょうか? 全部compressedだから良いような、とりあえずチェックしています。 https://developer.apple.com/library/ios/documentation/audiovideo/conceptual/multimediapg/usingaudio/usingaudio.html

Read full article | コメントは受け付けていません。

unity : bake into pose

8月 2nd, 2014

http://docs-jp.unity3d.com/Documentation/Manual/RootMotion.html Root Transform Rotation Bake into Pose:(ポーズ焼き込み) 向きは Body Transform(またはポーズ)に従います。Root の向きは一定値となり、差分の向きは Identity となります。つまり、Animation Clip によりゲームオブジェクトは一切回転されません。 これを設定していないと apply root motionを offにした時、回転しない。

Read full article | コメントは受け付けていません。