由用户创建的信息 Roman_Sementsov
30 May 2016 14:45
30 May 2016 13:57
26 May 2016 15:30
Hello
You can use the following approach:
1) create a curve loop (red ellipse)
2) animate an empty object on this curve
3) enable physics on the empty
4) enable the Special : Collision propety on the terrain material
5) every frame cast ray downwards from the empty
6) in the ray_test callback function you will get the intersection point between the ray and the terrain surface
7) move your object to the point
But in this case you have to create your own gravity interaction.
You can use the following approach:
1) create a curve loop (red ellipse)
2) animate an empty object on this curve
3) enable physics on the empty
4) enable the Special : Collision propety on the terrain material
5) every frame cast ray downwards from the empty
6) in the ray_test callback function you will get the intersection point between the ray and the terrain surface
7) move your object to the point
But in this case you have to create your own gravity interaction.
23 May 2016 09:42
Hello and welcome to the forum!
In the xmas example we use the canvas-texture to draw text into the texture. Take a look at this code snippet also.
To write text we use the textarea html-element:
In the xmas example we use the canvas-texture to draw text into the texture. Take a look at this code snippet also.
To write text we use the textarea html-element:
<textarea spellcheck="false" id = "text_element" rows="12"></textarea>
20 May 2016 14:00
Hello.
Texture image changing via API will be available in the upcoming release. But in your case, I advice you to use Sphere with spherical UV coords and the canvas texture. You can unwrap texture coordinates and draw the video on the canvas texture like in this tutorial.
Texture image changing via API will be available in the upcoming release. But in your case, I advice you to use Sphere with spherical UV coords and the canvas texture. You can unwrap texture coordinates and draw the video on the canvas texture like in this tutorial.
17 May 2016 19:01
Reply to post of user rafaelj
Hi,
I'm thinking to use blend4web, but I need to know if is easy to do user interfaces with user input text and numbers. And, how i use this numbers input to control the position of a 3d object?
(Brazil)
Hello and welcome to the forum.
You can use html elements to create interface. It's easy, I think. You can find examples in our SDK. Also take a look please at our demo scenes:
https://www.blend4web.com/en/demo/
17 May 2016 12:47
17 May 2016 09:44
Ответ на сообщение пользователя kokon
Спасибо большое за ответ! Смотрел вступление к Сказ о Пятигоре, очень понравилось, интерес не отпускает на всем протяжении демки. И вспомнил, там с неба летели огненные болиды, это то, что мне нужно.
p.s. Картинку с изображением планеты прикрепил.
Прикольная планета.
Тут вот еще одна есть, сделанная на b4w: http://worl3d.azurewebsites.net/
Кстати, на английском форуме пользователь так же делал планету, только с ракетой. вот ссылка на тему: https://www.blend4web.com/en/forums/topic/1919/
Может быть вам подойдет хвост ракеты
16 May 2016 10:03
Hello.
Be sure that your object is selectable:
I use the following code:
Also, I noticed that you use m_mouse.enable_mouse_hover_outline. You should enable the "Enable outlining" property:
Be sure that your object is selectable:
I use the following code:
"use strict"
// register the application module
b4w.register("AQSTES", function(exports, require) {
// import modules used by the app
var m_app = require("app");
var m_cfg = require("config");
var m_data = require("data");
var m_ver = require("version");
/*
from b4w tut
*/
var m_anim = require("animation");
//var m_app = require("app");
var m_cam = require("camera");
//var m_cfg = require("config");
var m_cont = require("container");
var m_cons = require("constraints");
var m_ctl = require("controls");
//var m_data = require("data");
var m_obj = require("objects");
var m_phy = require("physics");
var m_quat = require("quat");
var m_scenes = require("scenes");
var m_trans = require("transform");
var m_tsr = require("tsr");
var m_util = require("util");
var m_vec3 = require("vec3");
var m_mouse = require("mouse");
var m_main = require("main");
/**/
var _disable_interaction = false;
// detect application mode
var DEBUG = (m_ver.type() === "DEBUG");
// automatically detect assets path
var APP_ASSETS_PATH = m_cfg.get_std_assets_path() + "AQSTES/";
/**
* export the method to initialize the app (called at the bottom of this file)
*/
exports.init = function() {
m_app.init({
canvas_container_id: "main_canvas_container",
callback: init_cb,
show_fps: DEBUG,
console_verbose: DEBUG,
autoresize: true
});
}
/**
* callback executed when the app is initialized
*/
function init_cb(canvas_elem, success) {
if (!success) {
console.log("b4w init failure");
return;
}
load();
}
/**
* load the scene data
*/
function load() {
m_data.load(APP_ASSETS_PATH + "AQSTES.json", load_cb);
}
/**
* callback executed when the scene is loaded
*/
function load_cb(data_id, success) {
if (!success) {
console.log("b4w load failure");
return;
}
var cont = m_cont.get_container();
cont.addEventListener("mousedown", main_canvas_down, false);
console.log("Dilan");
m_mouse.enable_mouse_hover_outline();
m_app.enable_camera_controls();
// place your code here
var from = new Float32Array(3);
var to = new Float32Array(3);
}
function main_canvas_down(e) {
if (_disable_interaction)
return;
if (e.preventDefault)
e.preventDefault();
var x = m_mouse.get_coords_x(e);
var y = m_mouse.get_coords_y(e);
var obj = m_scenes.pick_object(x, y);
if (obj)
console.log(m_scenes.get_object_name(obj));
}
});
b4w.require("AQSTES").init();
Also, I noticed that you use m_mouse.enable_mouse_hover_outline. You should enable the "Enable outlining" property: