# Sensor live data feed into dynamic texture

**URL:** <https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825>\
**Category:** Questions\
**Tags:** material\
**Created:** [June 12, 2019, 2:17am UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825 "2019-06-12T02:17:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevenB](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@StevenB](https://forum.babylonjs.com/u/StevenB)\
**Post date:** [June 12, 2019, 2:17am UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/1 "2019-06-12T02:17:11Z")

</div>

I am looking to connect live sensor data to a plane or mesh. I want it to be able to accept live data feeds. I have researched setInterval(), however I am not proficient enough to solve. Has anyone attempted this before and or know a good direction for me to consider? Ultimately may add heat maps based upon live data and or just show the number values on the mesh. Any input welcomed.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 12, 2019, 10:49am UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/2 "2019-06-12T10:49:15Z")

</div>

It totally depends on how you receive the data cause if they were a one to one mapping they could be connected directly to the meshes info for instance.

As it is generally not the case though, I would consider updating the babylon data everyframe with the most recent available infos.

---

<div class="post-metadata">

**Author:** ![StevenB](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@StevenB](https://forum.babylonjs.com/u/StevenB)\
**Post date:** [June 12, 2019, 9:24pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/3 "2019-06-12T21:24:51Z")

</div>

Sebavan,  
Thanks for the prompt response. I am looking to have sensor data like room occupancy and have that graphically shown in a three dimensional room model in the web browser. I may have the data flow through signalR or some other streaming service that connects to a room sensor. Are you saying that scene update or another draw call method is best for this? I was wondering about performance for streaming data from devices. Ultimately I want to show both number info and heat map based upon live sensor data. I hope that makes sense. I am not a proficient programmer so examples are best for me to see how to code this process. Kind Regards  
Not to confuse the question but here is an example of using phone sensor data in a web model using signalR.  
[You Tube Video on signalR streaming data from phone](https://youtu.be/YwezzKWrFuo?t=324)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 12, 2019, 11:22pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/4 "2019-06-12T23:22:04Z")

</div>

I was more thinking about the update method. Wether you use signalR, [socket.io](http://socket.io) or other real time communication framework does not matter as much as how you pass those infos to the babylon scene.

As long as they are only transform infos it is all good to apply them directly (in most cases). Now creating the heat map per frame might be a bit much (even in term of data transfer) meaning you might need to think about update the map per tile in order to prevent blocking the rendering with long operations.

---

<div class="post-metadata">

**Author:** ![StevenB](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@StevenB](https://forum.babylonjs.com/u/StevenB)\
**Post date:** [June 13, 2019, 12:09am UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/5 "2019-06-13T00:09:13Z")

</div>

Sebava,  
Do you know of a good example / resource that I should take a look at? I have done a fair amount of searching, but having difficulty getting good info on this topic.

Thank you for your input.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 13, 2019, 11:14am UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/6 "2019-06-13T11:14:35Z")

</div>

Unfortunately not that I can think about but i bet @Wingnut or @JohnK might have some playgrounds links to share 🙂

---

<div class="post-metadata">

**Author:** ![StevenB](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@StevenB](https://forum.babylonjs.com/u/StevenB)\
**Post date:** [June 13, 2019, 12:26pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/7 "2019-06-13T12:26:46Z")

</div>

Thank you. I look forward to seeing what Babylon.js can do.

Cheers!

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [June 13, 2019, 1:31pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/8 "2019-06-13T13:31:53Z")

</div>

Hi guys. I think maybe @Deltakosh might be useful here. He’s a former Kinect god… and Kinect is… what? A thing… for live-connecting things… to other things.

But, no, I don’t have any playgrounds or demo scenes… that used streamed-in data to affect scene things.

Really, though… a mouse or gamepad IS a data-stream, I suppose. Other streamed things MIGHT connect to BJS scene… in similar ways. Whatever you can do with a mouse… you can do with a stream of packets from anything else, whether across a network or coming from local-machine into local scene (like our mice).

Ok, I’m at the border of MY knowledge on this subject (in fact, ICE is looking suspiciously at me, as if I might have stepped across the line already). 🙂 Interesting subject, though. Love it. I think a guy should at least LOOK AT Kinect… get its story… steal some code. 🙂

Oh yeah, there’s also @nasimiasl 's [http://500blog.com/](http://500blog.com/) (maybe hold the ‘W’ key for a few secs… when you first arrive)… which is the only full-time BJS “world server” that I know-of. It surely hands some packets around, but I know NOTHING about how it happens.

Topic-wander: I think “Naz” once offered ALL OF US… opportunity to build a personal place on that Planet 500, if we wish. Why send a personal forum message to me, when you can browse [http://500blog.com/wingoffice](http://500blog.com/wingoffice) and 3d live-chat with me, near my fireplace, in my VR “home”? FUN! Someday.

I don’t know if that offer is still valid, but it sure is/was a cool thing to offer us. (Wingy hugz Naz)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 13, 2019, 1:49pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/9 "2019-06-13T13:49:41Z")

</div>

Thanks 🙂

I wonder also if guyz doing multiplayer games could come in as it is totally the same idea.

---

<div class="post-metadata">

**Author:** ![nasimiasl](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nasimiasl/32/34_2.png) [@nasimiasl](https://forum.babylonjs.com/u/nasimiasl)\
**Post date:** [June 13, 2019, 4:50pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/10 "2019-06-13T16:50:36Z")

</div>

i see dream projects wanna catch me and kill me 🙂 but i close to finish 2 of them after that maybe i have time to back and be a useful a bit ☹

---

<div class="post-metadata">

**Author:** ![Wingnut](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/wingnut/32/53_2.png) [@Wingnut](https://forum.babylonjs.com/u/Wingnut)\
**Post date:** [June 13, 2019, 7:13pm UTC](https://forum.babylonjs.com/t/sensor-live-data-feed-into-dynamic-texture/3825/11 "2019-06-13T19:13:35Z")

</div>

No probs, Naz. No work to do, here. We are just talking about data-passing into BJS scene, or maybe about scene requesting data from outside. Just Wingy talking without any education. Normal. 😃
