question

Robin Brunner avatar image
3 Likes"
Robin Brunner asked Patrick Cloutier commented

Show State Pie and Statistics in 3D Model?

Is it possible to position my State Pie's and other Statistical Charts in my 3D Model? That would be really cool in combination with Oculus Rift.

Regards Robin

FlexSim 17.0.2
oculus riftstate piestatistic
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image
11 Likes"
Phil BoBo answered Patrick Cloutier commented

Starting in FlexSim 2018 Update 1, you can unload textures from the media list using the command unloadimage().

Using that functionality, you can do what @Allister Wilson is doing using FlexScript without custom C++ code. You can use viewtofile(), unloadimage(), loadimage(), and setobjecttextureindex() to do what you want.

See the attached example model (render-stats-test.fsm).

It is on the dev list to create an easier way to render stats charts in the 3D view, but in the meantime, this method can be used.


· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Mohamed Roushdy avatar image Mohamed Roushdy commented ·

-@phil.bobo could show me how exactly i reference the dashboard ( or the graph) required, as i have 3 graphs in 2 separate dashboards and i want to show them in the 3d view?

-the dashboard should be active?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Mohamed Roushdy commented ·

Yes, the dashboard needs to be visible so that it renders. This method doesn't render a view that isn't visible.

The "Render Dashboard to Texture" activity has the code that shows how to reference the dashboard charts. It references through the VIEW tree:

treenode view = node("VIEW:/1>Documents/Dashboard/1+/~/GraphPanel/1/1");

The VIEW tree keeps a list of certain opened windows. In that code, it is referencing the list of open Dashboard views, going to the first one and then referencing the first chart in that view. These references are all based on the tree structure of the views.

1 Like 1 ·
tree-reference.png (312.8 KiB)
Patrick Cloutier avatar image Patrick Cloutier commented ·
That is awesome. It works great !
0 Likes 0 ·
Clair A avatar image
3 Likes"
Clair A answered Phil BoBo converted comment to answer

Hi Robin,

We recently had the same question from a user. So a colleague @Allister Wilson has built a proof of concept.

Here is a screenshot:

And an animated gif of visualizing this chart inside the 3D view with the Oculus Rift:

This is custom development though, there is currently no built-in feature in the software. Feel free to ask @Allister Wilson if you want to know more about this proof of concept.


· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

jing.c avatar image jing.c commented ·

It looks great! @Allister Wilson Would you please offer more detail about how to realize it? or a sample model?

0 Likes 0 ·
Allister Wilson avatar image Allister Wilson jing.c commented ·

The basic idea is :

  • capture the dashboard view with GDI+
  • process it a bit (pixel format conversion, etc.)
  • upload the result to an OpenGL texture
  • draw it in FlexSim

It's not the best in terms of performance, and the update frequency isn't great, but it mostly works.

2 Likes 2 ·
Robin Brunner avatar image Robin Brunner Allister Wilson commented ·

Thank you for your concept. I will give it a try when I have time for it. Looks good in the GIFs.

0 Likes 0 ·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel commented

There is still the old Recorder Object in the library tree.The Recorder can show data, but the standard data structure has changed. Thus you can only show table data in the Recorder. You have to convert the State Data into the old data structure in a suitable table and you can use the table in the recorder.

createinstance(library().find("/Recorder"),model());

The code creates the old Recorder object. The States are ordered in an one column tables


recorder-reuse.fsm (22.7 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

David Seo avatar image David Seo commented ·

Oh. Really? Thanks, @Jorg Vogel.

Does it mean all dashboard's charts to be also displayed in the Recorder object like dashboard charts?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel David Seo commented ·

The Recorder is a deprecated object. You can try it with my approach to transfer dashboard data to a table and use the table as the data source of the Recorder. But you get a great loss in performance and the available adjustments are limited.

0 Likes 0 ·
David Seo avatar image
1 Like"
David Seo answered David Seo edited

3D Pie Charts, Histogram and trend Charts were possible in old version some years ago but these are changed to charts in dashboards.

But the numeric Statistics of 3D text type are possible in 3D model.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Mischa Spelt avatar image
0 Likes"
Mischa Spelt answered Matt Long commented

Hi Robin. I don't think this is currently possible, but I'm sure that if you were to post this as an idea it would get some upvotes.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Robin Brunner avatar image Robin Brunner commented ·

Thanks for your advises and hints. You helped me a lot. Great forum and community by the way!

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.