Forum

First day with blend4web...

26 November 2015 21:06
this was my first day with blend4web, I've started at 8:00 and now it's 18:23.
Yesterday I've installed the blend4web SDK and figured out how to set up a running server and was even able to build a simple test scene and view it in the 'Fast preview' page. figured out most of the rendering, lighting and materials set ups in Blender so I could launch a quite reasonable looking 3D web page eventually.
My aim is to create a scene with a first-person control that can walk through the scene, collide with walls and (hopefully) interact with some elements in the scene. Now, I'm no coder, my knowledge in coding ends up in basic HTML and some CSS and sometimes I feel I'm starting to develop symptoms of Code-phobia… it's not easy for me.
But, today I was experimenting a lot with the character thing, messing about with the .js file, Going through the 'Game creating' tutorials and eventually I've managed to get the camera collide with the walls and NOT going through the floor… one goal achieved.
Only, I still haven't solved the issue with - when looking at the floor and moving backwards my character starts flying backwards, up and away… For some reason the character control doesn't react to gravity even thou it's a 60 kg rigid body with all the necessary 'Physics enabled' check boxes turned on. it collides with walls but not fall down to the floor properly, What am I missing?
Unfortunately, another thing that I couldn't get to work for me was the blend4web Project manager. i understand it is still under heavy development but still I tried all the possible options (aka Default launch checkboxes, other combinations of turned on and off checkboxes) but couldn't compile a running scene.
All I get when running the HTML in the browser is a black screen and when I click on it I get the frame rate counter on the top right corner and a nice 3d blend4web logo on grey background. I wonder what I missed here…

In general, Blend4web is great, a bit of a tough nut to crack thou. I guess most of it's problem are because of it's young age and the need of a lot of attention and care. There is a great need for more tutorials and How-to tips and perhaps more clear and detailed documentation.
Will be back on it tomorrow. night everyone…
27 November 2015 06:01
Welcome, sounds like you made some great progress for one day!
Have you seen this video on the Project Manager?
https://www.youtube.com/watch?v=grgKti6qwSI
From what you say, I wonder if you are using the built in server that starts up with Blender (assuming you have Blend4Web installed). You can use a simple Python server but there is no need with the one that ships with Blend4Web.
27 November 2015 11:00
Hi Will, thank you for the Video link, it cleared out a few things for me especially the 'export to archive' and then the 'Import' step. Now I can see more or less how it works and what it does. I've followed the Video step by step and one thing I'm missing: the .blend that is being compiled, exported and imported is the default blend4web logo scene that carries the name of my project….
I have my scene opened in Blender (a very simple industrial area) with the camera character control (that is still flying about and refuses to behave like a rigid body should ), Oh, and I have the blend4web development server running on the Blender render tab (which by default starts running when I open Blender, Works great BTW), When pressing the 'Fast preview' my scene opens up in the browser as it should. So my question is - when I open the project manager and create a new project, compiling it, exporting and importing, it uses the default logo scene and not my scene?
Now, how is that for a NEWBIE question?…

***
Oh, One thing I forgot to mention is that I tried to build my project manually, meaning, copying the files (Following the 'First person' tutorial) to a new folder, including the HTML, js (after modifiying them), all the resources of my scene and then opening the HTML file from that folder and, it worked!
More or less… I got my scene in the browser the way it should look but no physics, meaning, I cant move my character but I can look around.
I don't have the default camera movement using the wasd keys so I guess it is because the camera is attached properly to the character, I can still look around for the camera's 'eye' control I guess, but I can't move my character, Probably I did something wrong with the .js file…
Well, back to nut cracking then…
27 November 2015 12:58
Two hours later…

Well, that was quite newbie of me..
All I had to do was to export the proper .json file from Blender to the proper directory … of course it works.
Sorry 'bout that…
28 November 2015 06:04
I think if we give you two more hours to figure this stuff out, I will be asking you questions
28 November 2015 09:24

That was the easy part, now it's messing with the coding…
28 November 2015 19:01
Well, Second day is over more or less… Still no luck with the coding part. Nothing moves yet…
I don't even know if the changes I'm doing are done in the right file. It seems that the 'Fast preview' is using different file set than the final compiled project And I can't figure out which ones are they, and even manipulating the final compiled .js files doesn't change anything when running the scene in the browser, hmm, and still I don't know if the changes are done in the right file… still digging up in tutorials files and my own project files trying to compare and understand the files structure and the code structure… it's all very confusing. .
Well. off for the weekend. maybe next week I'll do better…
Good weekend all
29 November 2015 08:17
Well, the idea is that you do all your developing and editing in the apps-dev side of things then compile to the deploy side where all the code is then minified and obviscated. You should be able to try all your files out by plugging their address into your browser like http://localhost:6687/apps_dev/my-project/whatever.html

You may also want to try a bundled project for simplicity. It pre-deploys all of your files , un-minified, to the deploy folder and you only then have on set of files to work with.
30 November 2015 10:19
OK Will, Thank you, I'll give it a try.
I have another question that I couldn't find an answer to, Where can I control the speed of the default camera's movement from the script files? or do I set it in Blender itself?
30 November 2015 12:48
Well , now I'm back to test the B4W Blender side of things, I'll be back to the coding and project exporting things when I'll understand more of the Blender options, and I ran into some odd behaviours -
of course I'm still into character and camera control things. i have a small scene With Camera, Rigid body Character control and a collidable area.
Now, When Character control object is NOT set as 'Character', meaning, the 'Character' checkbox is off in the Physics tab, I can control the camera speed in the 'camera move styles' and other functions just perfectly. The camera doesn't collide with the walls as expected. But when I tick the 'Character' checkbox On in the character object's physics tab, even though the camera is not parented to the character object and there is no known relationship between the camera and the character the move speed of the camera is back to default. any parameter changes in the 'character' setting (aka 'walk speed' and so on) doesn't change anything but the camera collides with the walls, which is nice, but, it doesnt fully react to the rigid body behaviour on the other hand, meaning, it doesnt fall to the ground as expected.
Hmm…
 
Please register or log in to leave a reply.