Jump to content

Recommendations for Graphics work

Recommended Posts

We are researching options for adding interactive 3D graphics capabilities to our desktop application which is written in C# .NET. Looks like adding some code to a Browser window might be a good option. Does Smart Mobile Studio have 3D graphics built in, or failing that, can you recommend third party Javascript libraries that SMS might interface with, so that I can hook up some 2-way communications (send data, get user feedback and so forth) between our desktop app and code running in the browser that displays 3D graphics?

We will be looking at both scatter plots in an XYZ space, and possibly placing raster images into an XYZ space along with interactive annotations, and some shapes containing custom fills or lines that join the image files in that space. Of course, real time interactive rotation and zooming capabilities would be required.

Thanks for any input or pointers you might provide, or possibly even some sample codes to look at along these lines. Just looking for Proof of Concept at this time.

Link to post
Share on other sites
  • Moderators

I have not been involved in anything similar, but looks like an interesting project. 

Out of the box SMS supports WebGL, which renders interactive 3D and 2D graphics within browsers without the need for additional libraries. However probably too low-level to consider.

Alternatively find and select a suitable javascript library (Vis.js ? Plot.ly ? three.js ?). Basically any javascript library can be made to run under SMS control and even when not pre-wrapped it is usually not too hard to use them.

To illustrate that point the snippet below executes a method from Googles TensorFlow.js neural network library. The commented line is the TensorFlow function call in javascript syntax, which is translated underneath in object pascal syntax (in this case using an anonymous class)

      // model.add(tf.layers.dense({units: 10, activation: 'sigmoid',inputShape: [2]}));
        units = 10;
        activation = 'sigmoid';
        inputShape : array[0..0] of integer = [2];


Would be interested to see how you would set up the 2-way communication between the desktop app and the browser window.


Link to post
Share on other sites

Thanks, lynkfs, that is very helpful. I don't mind doing the work of wrapping as it would most likely benefit the community if I do it well.

The 2-way communications are necessary in order to create "smart objects" relative to the application. Probably some kind of system of callbacks, or comms through a socket. I'm a Web newbie, discovery is  going to be some effort, and I MAY actually be talking through a random orifice 😮 in this respect, so please forgive me if I said something that is amiss. But speaking from decades of other programming experiences, there is NOTHING that the programmer cannot do if the imagination is motivated into doing something out of the box or otherwise inspired to something really creative and intelligent.


Cheers and thanks.

Link to post
Share on other sites

Did some preliminary research. Here is an example of 2-way comms between a C# Winforms program and an embedded HTML-script-capable browser window:


I ran this code in VS2017 and it works just fine. Video attached.


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...