Сообщения, созданные пользователем Иван Любовников
24 марта 2016 18:31
24 марта 2016 18:19
… кстати, если есть возможность, выскажите своё мнение по поводу возможности доработки дополнения и реализации кнопки Fast Export (json) на нижней панели вьюпорта …
Не пробовали настроить комбинацию клавиш на действие экспорта? Правда, все равно после этого будет диалог сохранения. Получится в итоге, например, Alt-E и потом Enter - тоже довольно удобно и быстро.
кнопку Fast Export для быстрого экспорта модели в папку проектаБленд-файл запоминает путь последнего экспорта, но для вновь созданного файла его все равно придется настраивать в первый раз. Кроме того, бленд-файл может быть не привязан ни к одному проекту (если вы о менеджере). Поэтому поведение такой кнопки не будет строго определённым и очевидным как "Fast Preview", т.к. файл будет экспортироваться по пути последнего экспорта, который может быть произвольным.
17 марта 2016 19:55
Is there a better way of doing this movement along the wall? Is there some way I can find the object that the ray from the camera is intersecting?
The easiest way is to calculate intersections with all of the walls, then take the point which is nearest to the camera position and set object translation according to it.
For example:
if (point_w)
var dist_w = m_vec3.squaredDistance(point_w, cam_trans);
else
var dist_w = 1e10;
if (point_wl)
var dist_wl = m_vec3.squaredDistance(point_wl, cam_trans);
else
var dist_wl = 1e10;
if (point_wr)
var dist_wr = m_vec3.squaredDistance(point_wr, cam_trans);
else
var dist_wr = 1e10;
var min_dist = min(dist_w, dist_wl, dist_wr);
if (min_dist == dist_w) {
// move object to point_w
} else if (min_dist == dist_wl) {
// move object to point_wl
} else {
// move object to point_wr
}
But there is also another way.
We can test which wall the ray should intersect. It means that the camera ray lies in a certain sector related to a certain wall:
Knowing a vector we can find its angle in polar coordinates via Math.atan2 function. Then we should test the ray vector against every vector directed from the camera to every corner point (which we obviously know).
Something, like this:
// calculate corner vectors
var cam_to_A = m_vec3.subtract(A, cam_trans, _vec3_tmp);
var cam_to_B = m_vec3.subtract(B, cam_trans, _vec3_tmp2);
var cam_to_C = m_vec3.subtract(C, cam_trans, _vec3_tmp3);
var cam_to_D = m_vec3.subtract(D, cam_trans, _vec3_tmp4);
// calculate angles in polar coordinates
var angle_ray = Math.atan2(camera_ray[0], camera_ray[2]);
var angle_A = Math.atan2(cam_to_A[0], cam_to_A[2]);
var angle_B = Math.atan2(cam_to_B[0], cam_to_B[2]);
var angle_C = Math.atan2(cam_to_C[0], cam_to_C[2]);
var angle_D = Math.atan2(cam_to_D[0], cam_to_D[2]);
// test
if (angle_ray >= angle_B && angle_ray <= angle_A) {
// test front wall only
}
...
16 марта 2016 23:49
16 марта 2016 17:24
It works for me both in Chrome and in Firefox without any error:
(i've just remove the camera limits to see the whole object)
This can be a browser-dependent issue. Do you reproduce it for the certain browser/OS? Does it happen in all browsers?
Also you don't need to place a video near the html file, because the video is already encoded in it.
(i've just remove the camera limits to see the whole object)
This can be a browser-dependent issue. Do you reproduce it for the certain browser/OS? Does it happen in all browsers?
Also you don't need to place a video near the html file, because the video is already encoded in it.
15 марта 2016 13:16
15 марта 2016 12:51
You're using rather old b4w.full.min.js library. It's 15.06 and is not compatible with the latest add-on version.
You should probably have another warning in the console:
B4W WARN: B4W engine version is a bit old relative to JSON. Some compatibility issues can occur. Update your engine version to fix it.
So, I suggest you to update your b4w.min.js.
More info here: https://www.blend4web.com/doc/en/addon.html#version-errors
You should probably have another warning in the console:
B4W WARN: B4W engine version is a bit old relative to JSON. Some compatibility issues can occur. Update your engine version to fix it.
So, I suggest you to update your b4w.min.js.
More info here: https://www.blend4web.com/doc/en/addon.html#version-errors
14 марта 2016 10:59
[INCOMPATIBLE IMAGE] Image size must be a multiple of 4:
/path/blabla/texture.png
Hi. This error appears during the dds-conversion. They're are also used for optimization purpose.
It needs to set some appropriate flags during the app initialization to use converted (dds or resized) resources. Please, look at the documentation, here:
https://www.blend4web.com/doc/en/developers.html#id22 ("for images (convert_dds)" section).
14 марта 2016 10:36
Can you see where the problem is ?Hi! Please, try to rename your file to 0001-0250-spatial.m4v.
More info about supported video formats:
https://www.blend4web.com/doc/en/textures.html#id22