论坛

由用户创建的信息 goeck
03 September 2015 16:18
right now I am trying to solve this with an inserted empty. The empty sits at the pivot point and is parented to the rotation object by this API call:
m_cons.append_stiff_trans_rot(child, target, trans_offset);

This seems to work out well, but the translatory offset isn't respected properly
03 September 2015 15:32
I don't know whether this is already solved, but I couldn't find similar posts here.

Is there a ready made way to rotate an object by API around a pivot point that's not the center of origin of the object?
I know I can accomplish this by using rotation matrix and translations but I'll try doing it a simpler way first.

Thanks for the help!
31 August 2015 15:21
Alright, awesome..this did the trick.
I also have physics enabled. Should I be using the set_translation() function of the physics module instead (did not try it yet)?
28 August 2015 13:15
I have my model with several bodies that I can move around by Javascript API calls.
The model has an armature which "connects" the bodies for animation purpose.
Now when I export the JSON with the armature I am not able to move the bodies by API calls anymore. Without exporting the armature API calls work fine, but the model seems discrambled. Some bodies fall apart of the rest . They seems to be held in place by the armature, in the JSON. The model looks good in blender. I already tried to play around with the bodies centers but this doesn't have any effect.
26 August 2015 12:29
OK, visual errors have gone, since I exported the armature with the model. It seems the armature attached parts got lost when I didn't export it with the model.
26 August 2015 11:58
OK, using the 15.08 SDK preview everything worked fine now. No errors.
For debugging reasons, is there a unminified version of the b4w javascript library or do I have to unminify it myself every time I change the SDK version?

Also I happen to have some strange visual errors in the model after export, but I might open another thread for this?
26 August 2015 09:36
Thank s for the replies.
I am trying out the 15.08 dev preview SDK in some minutes.
Actually using the 15.07 dev viewer, the JSON file gets loaded without any error.
Loading the same JSON from the selfmade viewer HTML results in the a[0].indexOf error…
25 August 2015 15:12
OK, sure. Please have a look at the attached blend file… Thanks so much for your support! I really appreciate it.
Also..one question by the way. I can't get the file loaded by the development viewer with the load parameter. Could you point me the way on how to successfully do this?
I used this URL: localhost:6687/apps_dev/viewer/viewer_dev.html?load=C:\MyDataFolder\model.json
25 August 2015 10:33
OK, after I've discarded exporting the armature the only error I get now is the following
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory
TypeError: a[0].indexOf is not a function
Actually I didn't have to all this when exporting an integrated HTML file from Blender, all this worked fine from the very beginning…
25 August 2015 09:54
I happen to have a exported JSON file loaded by html page. The script and the HTML file are basically taken from this example.

Now, when I load the file in Firefox I get a black rectangle and the following two errors in the console:
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory
TypeError: b.d.Ab.Ti[a.d.wc] is undefined
TypeError: e[h] is undefined
The latter returns all several milliseconds and stacks up in the console.
Even digging through the code, I can't see what could be the cause of this error.