Forum

how to use append_stiff_viewport(obj, camobj, positioning)

24 February 2016 11:36 #7660
i want use append_stiff_viewport(obj, camobj, positioning) to realization view ctrl

like Autodesk viewCube; then do this:

var mainCam = m_scs.get_active_camera();
var Cube = m_scs.get_object_by_name("Cube");
m_cons.append_stiff_viewport(Cube, mainCam, [32,0,32,0,10,0,1920,1080]);

brower console ERROR:
b4w.min.js:330 B4W ERROR: append_stiff_viewport: Wrong positioning params

how to use StiffViewportPositioning params.
Or there are other better ways to do this Like Autodesk ViewCube

thanks advance!
24 February 2016 11:52 #7665
Hello.

The positioning params should be an objects. You can read about this type in API doc. You need StiffViewportPositioning type
Blend4Web developer
24 February 2016 13:48 #7676
yes i read the API doc ,
but i Don't understand StiffViewportPositioning type and how set it!
need a demo to help me , plz !

Thanks again!

24 February 2016 14:16 #7677
For example:
var mainCam = m_scs.get_active_camera();
var Cube = m_scs.get_object_by_name("Cube");
var positioning_params = {
left : 2,
top: 0,
distance: 2,
rotation: new Float32Array([0, 0, 0, 1])
};
m_cons.append_stiff_viewport(Cube, mainCam, positioning_params);
Blend4Web developer
 
Please register or log in to leave a reply.