0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

unity > 時系列グラフの描画 > timeGraph > UDPでデータを受信

Last updated at Posted at 2015-09-09
実装
Unity 5.1.2-f1 on MacOS X 10.8.5

http://qiita.com/7of9/items/0a393470123815775617
の続き。

UDPで受信したデータをグラフにしたいというのが目指しているところ。

code

v0.2 @ github

UDPからの受信したデータをグラフにセットする実装をした。

スクリプトは以下がある

  • dataSetterScript.cs : 徐々に減少する線のデータをtimeGraphにセット
  • MyNetUtil.cs : IPアドレスの取得に使用
  • timeGraphScript.cs : 時系列グラフの描画
  • udpReceiverScript.cs : UDP受信。受信した数値をtimeGraphにセット

実行例

12時48分頃にUDP(ポート6000)にて以下を送信した。
-0.3

example.png

12時48分頃のところで線が垂直に折れ曲がっている。
これは、もともと徐々に減少していく線の描画に加えて、UDP送信したデータが混ざったのでこうなっている。

とりあえず、UDP送信したデータをグラフの点としてセットできるのがわかった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?