论坛

由用户创建的信息 Ivan Lyubovnikov
04 September 2017 12:33
yes, we're planning to support Convex Hull and Triangle Mesh eventually, I cannot say an exact date though, but should be before long
01 September 2017 10:59
Hi Juani,

Advantages of b4w: gravity can affect a single object if I want, in BGE the entire scene is affected as it applies to the world.
We can interact in real time, in bge we can not, it is a baked animation.
yes, this is true, although there is an example of how to do it for a single object in BGE by playing with conterforce: link

Cons of b4w: It is only applied to an axis, I understand that it is the z axis since the parameter is a number, not a vector. In bge you can apply the forces in the 3 axes.
yes, this is the amount of gravity along the Z axis
however, at first glance, it seems to be easy to implement the whole 3d vector for controlling gravity, we'll think about adding this feature to the physics API
28 August 2017 15:26
А как быть тем кто не использует "СДК" и не может выполнить соответсвующие команды в менеджере проектов?
ка то может стоит описать .." если использовалось … то заменить на …. итд"
?
если используете скомпилированную версию b4w.min.js, то делать ничего не нужно, а если разрабатываете с использованием скриптов dev-версии из папки src, то этот модуль нужно просто подключить в html-файле по аналогии с остальными:

...
<script type="text/javascript" src="../../src/main.js"></script>
<script type="text/javascript" src="../../src/material.js"></script>
<script type="text/javascript" src="../../src/math.js"></script>
...
25 August 2017 19:28
Hi, the canvas' styles are sort of "reserved", because they are controlled by the engine. You should set CSS styles for the canvas container element instead. This is the element whose id you pass as a "canvas_container_id" parameter into the app initialization method.
25 August 2017 19:15
Not in my case. It just silently failed and look at me with disdain…
Hmm, maybe it's not a simple javascript crash, but a blend4web freeze. I've noticed that in Cartoon Interior the engine's log messages are disabled at all, which is normal for the build but inconvenient for the dev version. You should try to enable it and then launch the app by the "dev: cartoon_interior.html" link. The logging can be here in the app.init method: https://github.com/TriumphLLC/Blend4Web/blob/17.06/apps_dev/tutorials/cartoon_interior/cartoon_interior.js#L66 by adding the following flag:
console_verbose: true
24 August 2017 10:40
How could i get more debug info from B4W because it just crashed and that was it.
the browser console is the first thing to check, it should show errors in a case of a crash as well as other log messages
23 August 2017 16:28
Hi,
for (i=0; i<9; i++) {
console.log(i)
}
This code should produce the "Uncaught ReferenceError: i is not defined" console message when pasted directly in one of the engine's modules. That's because there should be the line "use strict;" at the top of a module, that enables a special strict mode, in which JavaScript code should be executed. In short, this mode prevents from writing insecure or bad code and helps debugging. One of the limitations of the strict mode is that you cannot use undeclared variables. So, you just need to declare "i" via "var":
for (var i=0; i<9; i++) {
    console.log(i);
}

The browser console doesn't force strict mode, that's why you don't get any errors from simply typing in it.
18 August 2017 16:37
Hi, yes we've managed to found the reason of these memory leaks and have already fixed it. It's most likely that we will release LTS 17.06.3 today with this fix included.

Let me explain it a bit: this bug was related to a texture cache that the engine uses for dynamically loaded scenes to speed up the loading of the same resources (this is especially noticeable, when swapping through the same several scenes multiple times). This cache suffered from memory leaks and just failed to work in some cases. Now, with the mentioned fix you should be able to load scenes in the test project you attached above without crashing.

BUT, the cache still can grow, of course not so excessively as before the fix, but it can. It perfectly suits for configurator applications with the limited amount of resources, but if you need to load/unload many big and different scenes, e.g. different locations, game levels or something similar you should consider disabling the cache at all. For this reason we've also added the configuration parameter "enable_texture_cache", which you can set to "false" and pass into the app.init() method along with others.
18 August 2017 10:41
Вообще есть метод set_scale, но он к сожалению работает сразу по всем измерениям, поэтому, если нужно только ширину, то придется использовать другие варианты. Самый простой, наверное, - через Shape Keys - можно создать ключи в Блендере, и менять их потом в приложении через API.
Ещё можно через скелетную анимацию, если сделать, чтобы кость влияла на вершины, растягивая в нужном направлении (по сути аналогично shape keys, но посложнее), и использовать API модуля armature.js для перемещения кости.
Есть ещё низкоуровневые методы для работы с геометрией, вроде, extract_vertex_array и update_vertex_array, т.е. можно взять позиции всех вершин, вручную их "растянуть", а потом записать обратно в объект.
17 August 2017 12:19
В вашем примере "меблируем комнату" вычисляются координаты для клика мыши по канвасу вроде как написано, но по сути координаты при клике отсчитываются от самого браузера, в моем случае когда я канвасу сделал 80% ширины а остальные 20% для меню выделил, выходит при клике получал не те координаты , отсюда и невозможность выбрать объект для перемещения - он находился не там….
Если коротко, то нужно делать так:
var x = m_mouse.get_coords_x(e, false, true);
var y = m_mouse.get_coords_y(e, false, true);

Подробнее написано в этом разделе документации: Нестандартное расположение и ориентация элемента Canvas