Forum

First Person Camera Collision

16 May 2015 04:54 #2401
Hello,

I recently discovered B4W, and I am very excited to successfully implement it.

I've started by creating a scene that is navigated by the Eye Camera. The issue I'm having is getting the camera object to interact with anything (stopping at walls and obstacles). I've checked out the documentation, and one of the articles in the blog, but still have had no success. Is there a common oversight during this process?
16 May 2015 08:11 #2402
Hi, and welcome to this forum!

You might look at this tutorial for first-person view and physics setup.
Development Lead | Twitter
18 May 2015 05:18 #2413
Yes, I've looked at the demo, and the code. I copied the code and tried to manipulate it, but I haven't been able to accomplish what I've intended (see title).
The first thing I tried in the demo scene was to copy it, delete the hut, and try to navigate the scene. After only doing that, the keyboard controls ceased working (mouse is fine)- which is where I am stuck. I am surprised that swapping out scene objects broke the controls.
Working on the hut demo was attempted after spending the better part of a day on a failed attempt to figure out how to get the camera to collide with objects with a different scene exported from Blender.
Any suggestions to get this working?
18 May 2015 12:29 #2417
Ответ на сообщение пользователя Perrishnikov
Yes, I've looked at the demo, and the code. I copied the code and tried to manipulate it, but I haven't been able to accomplish what I've intended (see title).
The first thing I tried in the demo scene was to copy it, delete the hut, and try to navigate the scene. After only doing that, the keyboard controls ceased working (mouse is fine)- which is where I am stuck. I am surprised that swapping out scene objects broke the controls.
Working on the hut demo was attempted after spending the better part of a day on a failed attempt to figure out how to get the camera to collide with objects with a different scene exported from Blender.
Any suggestions to get this working?
Simple scene modifications can't influence controls this way. I suppose, there have been some other changes. Probably, some console output?
Does it work alright when you just reexport the original scene?

Blend4Web developer
19 May 2015 05:18 #2427

Ответ на сообщение пользователя Evgeny Rodygin
Simple scene modifications can't influence controls this way. I suppose, there have been some other changes. Probably, some console output?
Does it work alright when you just reexport the original scene?
Yes. It works fine if I simply duplicate the scene and run it as-is.
19 May 2015 12:41 #2433
Could you please provide us with modified blend-file? We will be able to check what is the problem this way.
Blend4Web developer
19 May 2015 19:36 #2438

Ответ на сообщение пользователя Evgeny Rodygin
Could you please provide us with modified blend-file? We will be able to check what is the problem this way.

Thanks. Your_text_here
20 May 2015 11:20 #2442
Ответ на сообщение пользователя Perrishnikov
Thanks. Your_text_here
I checked this scene. Everything works fine for me. There were definitely some more issues with your example. How do you perform export? Probably, you use "HTML Export" instead of typical "B4W export"?
Blend4Web developer
20 May 2015 22:47 #2447

Ответ на сообщение пользователя Evgeny Rodygin
I checked this scene. Everything works fine for me. There were definitely some more issues with your example. How do you perform export? Probably, you use "HTML Export" instead of typical "B4W export"?

I use the B4W export to HTML. I tried the JSON export to Viewer and was able to navigate the scene through flying.

I've played around with it some more, and I still cant get the keyboard controls to work in localhost with the default firstperson tutorial.
21 May 2015 11:01 #2451
Ответ на сообщение пользователя Perrishnikov
I use the B4W export to HTML. I tried the JSON export to Viewer and was able to navigate the scene through flying.

I've played around with it some more, and I still cant get the keyboard controls to work in localhost with the default firstperson tutorial.
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
Blend4Web developer
 
Please register or log in to leave a reply.