Forum

User posts Evgeny Rodygin
19 January 2015 14:51
Hi,

I've looked through your code. When you use:
m_util.clamp(dest_pan_y_mouse, 0.2, -0.2);
you clamp only the value which is added to the result Y coordinate. Not the Y coordinate itself that is wrong.

I've come to the following solution for your task. It works exactly as you described:
var pivot = m_cam.get_pivot(obj);
if (pivot[1] >= 1 && trans_pivot_y_mouse < 0 ||
    pivot[1] <= 0 && trans_pivot_y_mouse > 0) {
    // do nothing
    } else {
        m_cam.move_pivot(obj, trans_pivot_x_mouse, trans_pivot_y_mouse);
    }
}

I've modified your version of app.js. It is in the attachment.
15 January 2015 11:57
Hi,
Here is my tutorial request: An example scene with an environment JSON, then a cube and a sphere loaded from separate JSON files, placed in the environment via code, and a constant glow around both, and hey, why not make the cube and sphere hotlinks at the same time.
Not a tutorial but a small scene. A monkey and a sphere are loaded dynamically in the hidden mode to prevent user from seeing this objects partially loaded. Then in the loaded callbacks they are moved to the specific location and are made visible with the following code:
m_scenes.show_object(monkey);
m_trans.set_translation(monkey, 0, 2, 0);

Pay attention to the settings of the dynamically loaded objects. They should have a "do_not_batch" flag to disable optimization and allow translating them and a "selectable" flag for glow effect.
The scene is in the attachment.
13 January 2015 11:19

Now I tried out that false path animation where there is actually location animation.
https://sisu.ut.ee/sites/default/files/blender/files/homopolar_motor_0.html
https://sisu.ut.ee/sites/default/files/blender/files/homopolar_motor_v3_1.blend
Really nice work, Nils!
The only little problem I've noticed: the cube you placed to mask a fake animation has a bit different color (not perfectly white) than a background. Thus we can see it if we'll move the camera a bit higher.
05 January 2015 18:30
Hi Nils,

The only way to make path animation is to bake it with a standard Blender action baker. The menu is under Object->Animation->Bake Action. And then use fresh baked animation without any constraints attached.

26 December 2014 10:57
Hi trepaning,

I've made a very simple app (attached to the post) which redirects you to the other page. I think that's pretty much what you've described.
Take a look at example.js. There are just 5 important lines of code in main_canvas_click function.

If you want to open your link in a new tab you may replace the line:
window.location.href = "http://www.blend4web.com";

with
window.open("http://www.blend4web.com");

22 December 2014 14:32
You should think about having a "buy us a beer" link for people to donate so it is easy to donate to you guys without buying 1,000 dollars worth of commercial license
Though our site's admin prefers Cola, I'll tell him about this "feature request".
22 December 2014 10:15
In the next few days we'll release Blend4Web 14.12. There will be a new demo scene which has the functionality pretty close to what you've described. It uses our new canvas texture as an input. So it is better to wait a bit and use this scene as a tutorial I think.
19 December 2014 15:21
Hi,

I'm not sure if I've understood you correctly, but I think the answer is: "Yes, it is possible".
To clarify the issue. Do you want to have some graphical - made in Blender, possibly 3D - interface which you will use as an input for some user's info which can later be send to the server or processed in some other way?
18 December 2014 10:41
Hi,
1: I would like to see my object rotating on the scene. If possible the automatic rotation, the same I can choose from the bottom right menu, but set ON by default.
You may animate your object with a simple rotation in Blender and under Blend4Web setting in object interface set Animation->Use default and Animation->Behaviour->Cyclic.
If you want the whole scene to be rotated you can do the same manipulations with camera (e.g. rotate it around the scene). But make sure you've changed Camera Move Style to Static, so that mouse/keyboard controls won't affect camera position.
2: Yes. url links inside the scene.
You surely can do this. But it'll require a bit programming. If you want a new page to be loaded when a user clicks on a specific object you need to make this object Selectable and register mouse_click event on your canvas element. Then use the scenes.pick_object function. It returns object placed in x,y screen coordinates. If this is needed object you can redirect to some needed page
17 December 2014 11:12
Hi,
could we get easy access to add proper <title> and <meta description> tags
If we would have only one export format - html - such options would be alright. But as we have a json export format these options would bring some ambiguities.

Thus I'd recommend using method described in part 3 of this tutorial and run your application in resizeable canvas.