Форум

Сообщения, созданные пользователем Will Welker
13 ноября 2016 06:09
Here is something you can try to get you started. Export a scene using the HTML option, then load the file onto a mobile phone. Once the scene is loaded on your phone, tap the options gear in the lower right corner. One of the settings will switch the view into stereoscopic 3D (select full screen option as well). You will need some kind of device like Google cardboard or GearVR to put your phone into.
My home page is a simple scene exported with the HTML option. You could point the browser on your phone to williamwelker.com to have a look. I have only tried this with Chrome on Android.
I believe that Blend4web is trying to author 3D content according to what the browsers will support. I haven't tried this with a computer attached VR device like Oculas but basically, browsers are at a point where they can serve up a stereoscopic view and update the view based on head tracking input from the device.
P.S. We need a VR emoticon
08 ноября 2016 01:24
One Pitfall is that if any time you try to remove the addon, it can actually delete some of the Blend4web files from the SDK directory. I have solved this issue by installing a freshly unpacked version of the SDK and as well you may want to reinstall blender. I have my SDK on a portable drive and move it between Windows and Ubuntu with great success. But while setting that up I had issues like you described. It seems like if you put the SDK on one drive and then try to change it to another drive Blender can remember some of the older settings. Reinstalling Blender solved this for me.
06 ноября 2016 17:54
Wow!
Great job!
I will get your changes commited to the Github repo.
If I run two browser tabs, the latency is not bad at all. I am in North Idaho USA, I guess your server is in Moscow. 1/2 second maybe. That is very encouraging

Hmmm, wonder who I am playing chess with ??
06 ноября 2016 04:14
Hope the exams went well
I have been poking away at this when I get time. Here is my server side code so far. Basically I have made an object to hold the beginning positions and copied it to another object to store the current changing positions.
var express = require('express');
var app = express();
var serv = require('http').Server(app);
var objectAssign = require('object-assign');
var io = require('socket.io')(serv,{});

app.get('/',function(req, res) {
    res.sendFile(__dirname + '/public/index.html');
});
app.use(express.static('public'));
 
serv.listen(2000);
console.log("Server started v101");
 
var SOCKET_LIST = {};
var PLAYER_LIST = {};
//Object with all set up positions
var RESET_POS = {   
    bkr: [-7,0,-7], //black
    bkk: [-5,0,-7],
    bkb: [-3,0,-7],
    bk: [-1,0,-7],
    bq: [1,0,-7],
    bqb: [3,0,-7],
    bqk: [5,0,-7],
    bqr: [7,0,-7],
    bkrp: [-7,0,-5], //pawns
    bkkp: [-5,0,-5],
    bkbp: [-3,0,-5],
    bkp: [-1,0,-5],
    bqp: [1,0,-5],
    bqbp: [3,0,-5],
    bqkp: [5,0,-5],
    bqrp: [7,0,-5],
    wkr: [-7,0,7],  //white
    wkk: [-5,0,7],
    wkb: [-3,0,7],
    wk: [-1,0,7],
    wq: [1,0,7],
    wqb: [3,0,7],
    wqk: [5,0,7],
    wqr: [7,0,7],
    wkrp: [-7,0,5], //pawns
    wkkp: [-5,0,5],
    wkbp: [-3,0,5],
    wkp: [-1,0,5],
    wqp: [1,0,5],
    wqbp: [3,0,5],
    wqkp: [5,0,5],
    wqrp: [7,0,5]
};
// Copy the RESET_POS values to a new object to store the changing positions
var CURRENT_POSITIONS = objectAssign({},RESET_POS); 
console.log(CURRENT_POSITIONS);



setInterval(function(){
    // loop here
   
   
   
},1000/25);


I have Node.js running on an Ubuntu server here: http://bambinobot.com/
Currently it is just serving up the static chess app. It is showing the moving chess piece positions in the browser console.
My current to-do list:
    Scale the chessboard size so positions are whole numbers. Client should load CURRENT_POSITIONS from the server when logging in Put socket.emit position into the main_canvas_move() function in the client code. As the server chess piece position is updated, it should send update to the clients. When the client is moving its piece, should disable receiving updated position from the server so they aren't fighting. Periodically the server should loop through all the pieces to correct client positions in case of error.

Project on Github
I am not a pro coder so any help and advice is much appreciated!
25 октября 2016 19:53
Sounds great Mikhail, Thanks!
24 октября 2016 20:21
Github.
For an open source B4W project. I am working on a multi-player node.js application.
The primary purpose is to learn my self how to use node.js but also I think there could be huge potential for Blend4web and Node.js to make multi user interactive applications.
23 октября 2016 10:44
Mikhail,
When you want to version control your B4W app, do you run Git from inside the SDK directory? Or do you copy it out into another directory every time you want to commit? I am trying to find a way to easily run Git on my B4W apps. If I used a bundled project, I could run Git from that one folder. Is there a better way?
18 октября 2016 07:29
I have a chess app I have been putting together. The code is mostly from the Cartoon Interior project.
http://williamwelker.com/b4w/nodejs/
JS File
Blend file

Currently if you hit F12 to see the browser console log, you can see the position data is getting logged when you move pieces. The plan is to run this through a node.js server and database so multiple people can view and interact with the app. So when we get the back-end running, it should position the pieces according to the data on the node.js server. My next step will be to work on the server-side code then interface it with the client running in the browser. User login, security and authentication can come later.
Also, I am not trying to put in any chess logic. Like a real chessboard, everything can just be moved around.

Server question for anybody who can answer: This app is served from a normal web server. I have node.js running on another public server (Ubuntu). Will this app be able to open a socket on a separate server like that?

Kirill's client code:
function init_set(){
      var socket = io.connect('http://95.215.108.215:8080/');
      socket.on('connect', function () {
        socket.emit('type_client', 'vis');

        socket.on('new_quat', function (quat) {
            m_trans.set_rotation(_obj, quat[1],quat[2],quat[3],quat[0])
          console.log({quat:quat});
        });
      });
}
12 октября 2016 16:39
Okay. No reason to hurry. I am learning Node.js now and I don't learn very fast
I have Ubuntu server up and running and I am starting to play with the code. Godaddy.com has pretty good deals on Node.js servers so I am trying it out. I am sure there are many other web service companies that can provide a server but I already use Godaddy.
11 октября 2016 20:48
Great Node.js tutoroal here:
https://youtu.be/PfSwUOBL1YQ