Forum

Is this the right toolset?

30 January 2018 12:39
I want to end up in a position to programmatically add a 3D model to a scene and then dynamically add a number of objects to that scene, each of which can behave like a hyperlink and then I want that scene to be presented as a part of a web-page or web-application.
I would prefer that the outputs of this process do not require an special 'services' to be running in support of the web-pages that use them. In short I would prefer that this content just sits on the filesystem until called upon and that a typical web-server is all that is needed to serve this content.
I retired 5 years ago; I have 18 years programming experience but none of that is with Python, most of my experience is with object oriented languages such as VB, C# etc.
30 January 2018 18:19
Hello! And welcome to our forum!

Yes of course you can load objects and use them as hyperlinks. Try to use Logic Editor. Maybe for your case no programming is needed. To make hyperlinks use Select and Page Redirect nodes.

I have 18 years programming experience but none of that is with Python, most of my experience is with object oriented languages such as VB, C# etc.

No Python programming is required. Blend4Web engine is written with JavaScript and it uses native browser technologies.
Feel free to ask any questions
Alexander (Blend4Web Team)
twitter
30 January 2018 20:21
Thanks for your reply,
I would want to end up with a fully automated process, this part is just one of the stages (well… maybe two or three!).
The process starts with a user uploading material for processing within another toolset which results in the generation of a 3D model, that model will then need to be imported and then a large number of small objects/icons/geometric shapes will need to be added (with hyperlinks) relative to the original subject matter .. each hyperlink provide access to instance specific functionality on the same website.

I will need to learn how to import the 3D model and then how to generate the geometric shapes with hyperlinks, I expect the results will need to be packaged up in some way so that it can be saved at rest for rendering on demand as and when the web-server is asked.

Is there a library of scripts that can be used as a starting point for such a development task?
31 January 2018 11:26
Now I see that for your case programming is preferable.

The process starts with a user uploading material for processing which results in the generation of a 3D model, that model will need to be imported and then a large number of small objects/icons/geometric shapes will need to be added.. their hyperlinks provide access to additional functionality.

Material? Do you mean some resource? A file in some format? We usually use a term "material" for 3D models materials.

The generated 3D model consists of "large number of small objects/icons/geometric shapes" ? they should be placed on the scene and click handlers for each of them are required?

I will need to learn how to import the 3D model and then how to generate the geometric shapes with hyperlinks

Currently Blend4Web engine can load models using its own format (.json + .bin). The objects generation from scratch is not supported currently (we are working on this issues just now), but you can copy an existing object and replace it's geometry.
Look at this code snippet example about dynamic geometry. Since you want your objects to be clickable, you need check "Selectable" flag for the original object in Blender (object with name "Plane" from the code snippet).

I expect the results will need to be packaged up in some way so that it can be saved at rest for rendering on demand as and when the web-server is asked.

The usual use case for Blend4Web is to load .json+.bin which were exported from Blender, so your models can be packet into .json+.bin. But if you need dynamically generated models you can use your own format and generate them on the fly (see cod snippet example mentioned above)
Alexander (Blend4Web Team)
twitter
31 January 2018 11:32
Thanks for that, I was looking at those examples yesterday. I'll have a closer look today.

Is it possible to use a real world coordinates system such as WGS84 so that the resultant model can be shown with its proper orientation in the correct location against a background map?
31 January 2018 12:35
The objects that I want to add to the scene would be translucent if possible and will look like a wire frame (imagine a rectangle drawn in the XY with a dot drawn at an offset along the Z axis, like a stylized arrow head), I would prefer that each of these objects can be highlighted if activated (clicked) but only one of these objects can be highlighted at any one time. I would also hope that each of these objects can be modified slightly when clicked to indicate that they have been used (ticked) (following the hyperlinks presents me with an opportunity to update the status of the source data so that it can be persisted)
These objects will move relative to the 3D model also in the scene, The scene will not be animated at all and so every element of the scene will have a static position relative to all the other elements which will never change.
Right now I believe that I need scripts to create a new project and then import the foreign 3d model (ie an .obj or .3ds file) then carry out any real world location & orientation if possible, then proceed to generate the geometric objects to a scene by prescribing location and attitude data for each object. I'm not sure where this project sits best in the Blender ecosystem.

If its possible to build an entity that includes the imported foreign 3D model and all the geometric objects in advance and then populate its status data at runtime via the web-server then I suspect that doing so would be the perfect solution.
31 January 2018 13:06
Blend4Web uses 3-dimensional Euclidean space and all objects are drawn in this space. What is your purpose of using WGS84 ? If you want to e.g. place some object using WGS84 and keep its shape non-modified, you just should find correct transformation for the position. Shape of the model will be drown in Euclidean space anyway. Look at the proj4js library.
Alexander (Blend4Web Team)
twitter
31 January 2018 13:24
Frankly Alexander I'm not sure that I need to place the model on a map at all… I expect that placing a pin on a map that links to the model will be adequate. I was just thinking out loud I guess.

imagine that we make models of architectural art objects and that we want to add annotations that are directed at a specific facet of the object… the annotations may take the form of images or dialogue and to following a link to that content would allow for a dynamic response. Its easy to see why we want to place the objects on a map as each project may include several independent objects.
31 January 2018 13:59
The whole picture still is not clear for me, but for annotations you can use anchors. And annotations body you can include html code with links.
Alexander (Blend4Web Team)
twitter
 
Please register or log in to leave a reply.