Forum

First Person Camera Collision

21 May 2015 20:28

Ответ на сообщение пользователя Evgeny Rodygin
Well. HTML is not an option to use here. It even doesn't support physics. I'd recommend reading this tutorial for better understanding of what export options does Blend4Web offer.

The Firstperson example (and any other example) is kinda a standalone application and it have all the required files in its sub-directory: blend4web/deploy/tutorials/examples/firstperson. Thus, after updating the current scene, you need to reexport it to this folder, replacing existing first-person.json. Then, you can check the result by running example.html in your browser.
Don't forget to allow browser to open local resources: Link with description

Is there a way to export the BGE controls into something that BW4 can interpret?
22 May 2015 12:40
Hi.

Is there a way to export the BGE controls into something that BW4 can interpret?

No, there isn’t. You can read about it in our faq
26 May 2015 22:43
Alright. I've managed to get a demo up and running using the .json export.

A few issues:
I can get the demo to run through the "canvas3d" div, but I haven't been able to resize or reposition the canvas in the webpage. So I tried using the webplayer, and I managed to use an iframe and resize and position it where I want it, but the problem here is that the camera flies around the scene as opposed to walking on the ground (worked as intended in the div).

What do I need to do to both scenarios to get them to operate as intended?

Thanks!
27 May 2015 12:11
Ответ на сообщение пользователя Perrishnikov
Alright. I've managed to get a demo up and running using the .json export.

A few issues:
I can get the demo to run through the "canvas3d" div, but I haven't been able to resize or reposition the canvas in the webpage. So I tried using the webplayer, and I managed to use an iframe and resize and position it where I want it, but the problem here is that the camera flies around the scene as opposed to walking on the ground (worked as intended in the div).

What do I need to do to both scenarios to get them to operate as intended?

Thanks!
You can match the size of the canvas to its container by calling m_app.resize_to_container() function. The other option is to send the following parameter to the m_app.init() function:
m_app.init({
...
    autoresize: true,
...
});

Then you can set the proper size of the canvas container and the canvas will change its size.
For positioning the canvas you can use such html-properties as "margin-left, margin-top" etc. And don't forget to set position: relative in the canvas-container style.
07 January 2016 19:41
someone could make a video tutorial? Thank you.
08 January 2016 14:35
Is posible blend4web can tell that does not hide the mouse when you are moving the camera?
I want to click on objects (in canvas caption) without having to give the esc key. Thank you.
08 January 2016 21:36
Ответ на сообщение пользователя pakirrote
Is posible blend4web can tell that does not hide the mouse when you are moving the camera?
I want to click on objects (in canvas caption) without having to give the esc key. Thank you.
I answered in this thread. Currently, it is not possible, because this behavior is a part of browser engines.
 
Please register or log in to leave a reply.