Forum

User posts Ivan Lyubovnikov
09 September 2015 17:07

i export html in chrome but no glow when i click my objects
Hi!
Automatic glowing on selection is available only if an application allows you to "select" an object. For example, the selection is currently enabled in the Viewer app, but not in the Webplayer, which is used for the HTML export. We'll probably implement this feature in Webplayer later.

Nevertheless you can get this glowing effect using the new Logic Editor. I've made some modifications in your blend-file and attached it to the post. Now it works by using the logic nodes.
09 September 2015 12:08
можно
09 September 2015 11:01

Приветствую, при попытке скопировать объект с физикой выскакивает ошибка в консоли:
Да, это баг, мы его поправим к следующему релизу. Но пока чтобы долго не ждать, я прикрепил слегка видоизмененную библиотеку b4w.full.min.js, можете заменить ей свою - ошибки уже не будет.
07 September 2015 17:06
Methematically this is everything that needs to be done, I was just wondering whether there is a readymade function for this already in the API.

We don't have an API function like this, because such transform is a specific case - one among many, and it can be done by a developer himself using the API of the vec3, vec4, mat3, mat4 and quat modules. So it's just a bit low-level at the moment . Perhaps, we'll cover the most common cases in the future and will make the API easier.


I don't see rotate_point_pivot() somewhere documented in v15.08.
Sorry for confusing you. This is not an API function. I mentioned it as an example how we do it inside the engine. Here is the link to source: rotate_point_pivot

03 September 2015 19:04

This seems to work out well, but the translatory offset isn't respected properly
trans_offset should be set in the parent's local space. So the parent transforms (e.g non-unit scale) can additionally affect child position in the world space.

Actually you don't need any constraint to achieve such rotation. If you have the pivot and the rotation axis it can be done in the following way:

1) get the vector directed from the object position to the pivot
2) rotate it around specific axis using a quaternion
3) calculate destination point by adding transformed vector to the pivot point

Something similar is calculated in the rotate_point_pivot function.

You can get the appropriate quaternion from this function:
setAxisAngle.
26 August 2015 15:28

OK, using the 15.08 SDK preview everything worked fine now. No errors.
I'm glad it helped!

For debugging reasons, is there a unminified version of the b4w javascript library or do I have to unminify it myself every time I change the SDK version?
You can develop an application within the SDK, which means that you'll have an access to the dev version(source code) of the b4w engine (source code is placed here: <path_to_sdk>/src/*).

Unfortunately, this is a bit unstable at the moment even in the Developer Preview (we are currently working on this feature). So you need to wait stable release.
The developing process would also be described here in the documentation:
https://www.blend4web.com/doc/en/developers.html#sdk (it's a bit outdated by now)
25 August 2015 19:10

OK, after I've discarded exporting the armature the only error I get now is the following
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory
TypeError: a[0].indexOf is not a function
Actually I didn't have to all this when exporting an integrated HTML file from Blender, all this worked fine from the very beginning…

OK, B4W WARN signalizes about incorrect naming of the loaded b4w js library ("b4w.full.js" in your case, but it should be "b4w.full.min.js"). This warning doesn't really affect anything.

The other error is reproduced using b4w15.07 version. But we've made many changes since the last release and it isn't reproduced when using the actual code. So I suggest you to wait for the next release and upgrade to 15.08. Probably it will be out by the weekend.
25 August 2015 17:38

Also..one question by the way. I can't get the file loaded by the development viewer with the load parameter. Could you point me the way on how to successfully do this?
I used this URL: localhost:6687/apps_dev/viewer/viewer_dev.html?load=C:\MyDataFolder\model.json

The simplest way to do this is using "Run in Viewer" export option. So Blender will launch your default browser after export and will run the scene automatically in Viewer.

One thing, it requires to export your scene inside blend4web sdk folder, because our local development server is configured to serve this directory.

Of course you can edit the "load" parameter manually, but it should start with the same domain "http://localhost:6687/…" or should be a relative path (relative to server root - blend4web sdk folder) for example: "../../deploy/assets/misc/logo.json".

25 August 2015 13:01

Ответ на сообщение пользователя goeck
OK, after I've discarded exporting the armature the only error I get now is the following

Actually I didn't have to all this when exporting an integrated HTML file from Blender, all this worked fine from the very beginning…

Hi! Can you attach your example? It would be easier to understand what went wrong.
24 August 2015 11:46

Избавился от проблема переназначив координаты курсора
с
var x = m_mouse.get_coords_x(e);
var y = m_mouse.get_coords_y(e);

на
var x = e.pageX;
var y = e.pageY;

Да, действительно, при получении координат canvas'а нужно учитывать скроллинг. Функции get_coords_x/y возвращают координаты clientX/Y, которые соответствуют текущему вьюпорту браузера и не берут в расчет скроллинг вообще. В вашем случае, как я понял, скроллится только окно браузера - для этого идеально подходят свойства pageX/Y.

Но есть и более сложные варианты расположения canvas'а, например, скроллинг внутри отдельных элементов страницы, смещение canvas'а относительно верхнего левого угла, изменение его позиции javascript'ом и т.д. Для этого в движке есть функционал по пересчету координат, как им пользоваться, описано в соответствующем разделе документации.