Forum

User posts Mentalist
04 February 2016 07:17
While experimenting with reflective and refractive materials I noticed that a transparent material behind another transparent material becomes completely invisible. Is there a setting I can change to increase the transparency sampling and make such objects appear?
Thanks



In the screen shot above, notice how the green sphere (a reflective but opaque object) appears in the refraction of the blue torus, however the yellow cube (a transparent object) does not.
We also don't see the back side of the objects themselves, even though the Transparency Type is set to Alpha Sort.

reflection_and_refraction.blend
03 February 2016 17:06
@Konstantin Khomyakov Thank you for suggesting this idea! Let me see if I understand correctly…
You can for example divide screen in six areas and move your plane/spaceship between them
Do you mean that the plane could be moved to each of the six corners of an invisible cube (in front of the camera)?

I will surely need Viewport Alignment for this and other projects too, so thanks for telling me what that feature is called and where to find an example.

I'm still exploring the possibilities. One thing is for sure - there's no getting around the fact that I need to learn to set up first-person controls sooner or later. I feel that I really should face this, and overcome my aversion to coding.
In any case am curious to learn more about the solution you have suggested.

Another idea I had, since there are no aircraft presets yet, is that maybe I can sort of hack a watercraft setup into working without visible water under it - maybe parenting a block of some kind of "fake" water to it to get it moving through the air. But I haven't even made a conventional watercraft yet, so I am getting ahead of myself.

@LukeVideo
Thanks for offering your .blend to study. I have never used the BGE before, so I'm not even sure where to start. I pressed 'P' and got the car to move using the arrow keys. I couldn't figure out why it disappears sometimes, or why everything is scaled up so large (scaling it down made the car disappear even more easily). Studying the BGE in order to learn B4W seems like the long way to do it, so for now I think I'll just focus on B4W. I appreciate the gesture though.
02 February 2016 03:03

I think it is a wonderful starter project idea. There is no serious flight simulators of any kind yet on b4w. So it will be really interesting for us to keep track of your app and help to solve problems which you will face
Thank you so much for the support!
01 February 2016 19:12

Sorry, can't find any key-frames in blender. If i understand everything right, you want to animate empty to get missile move slower and slower with time. So you need somehow start this animation (apply default or with logic node or some other way)
In the .blend files I attached, the empties are not key-framed. Sorry I wasn't clear about that.

Regarding my larger objectives with this, I want to accomplish a few different things in a flight simulator game:

1) Planes should fly (Sounds simple, but I think it will be quite tricky. Evgeny has offered me some advice, but I'm still too much of a newbie to implement it.)
2) The planes should be able to shoot missiles and fire machine guns. Experimenting with methods for doing this was the purpose of this thread.
3) Missiles and other weapons should cause damage. I haven't reached this point yet.

This is currently way beyond my level of ability, so I have been doing some experiments and trying to learn B4W one piece at a time. There is a project I have in mind after this too, but I have to learn a lot more before I can even attempt it.
01 February 2016 15:25

I got it!
It is a terrible bug
If you use non integer variables for Y or Z translation/rotation their decimal parts will be ignored.

So sorry for that!
We'll fix it in the nearest release

Ah, I was wondering if it was a bug. I guessed it was more likely my lack of understanding.
This is good news that I could help with discovering a bug! No need to apologize.

Move To takes physics into account. Physics properties for each object are declared in specific panel, you can find info in docs:
https://www.blend4web.com/doc/en/physics.html

This is really good to know!

Thank you, on both of these points!
01 February 2016 12:15

You can for example use variable for duration parameter in your transform node and increase/decrease it in loop
Thank you, Konstantin.
I was not able to get the variable to accept a non-integer value. I tried 0.5, 0.1, etc. but it did not work. What is the correct way to do this?
01 February 2016 11:51
In addition to the Transform Object node, I have also done some experimenting with the Move To node.

One effect I have been able to achieve is creating a self-propelled missile that chases an empty in front of it. Since the empty is parented to the missile it remains in front of it forever, and the missile continues to chase it forever.
To my surprise, key-framing the empty to gradually get closer to the missile did not cause the missile to slow down over time.

missile_self-propulsion.blend

In a second experiment I had the missile seek a target. The target will also move when clicked, so that the missile can be fired at it again. In order to keep it in view, the camera also gets re-positioned each time this happens (although the distance seems to have some variation each time).

missile_seek_target.blend



I don't know how "on target" my approach is though in terms of being usable in a game, because none of this takes physics into account. But it's the most I could figure out so far using only the Logic Editor.
31 January 2016 22:49
Thank you Alexander! I've got it working now!

Result: b4w_armature_deform_b4wbaked.blend

I don't know if this is worth mentioning or not, but I initially got this error when I clicked the Bake button:
Traceback (most recent call last):
File "/Users/user/blend4web_sdk_free/addons/blend4web/anim_baker.py", line 90, in execute
self.process_action(action, armobj)
File "/Users/user/blend4web_sdk_free/addons/blend4web/anim_baker.py", line 207, in process_action
armobj.animation_data.action = action
AttributeError: bpy_struct: attribute "action" from "AnimData" is read-only

location: <unknown location>:-1

I think this is because I downloaded the .blend file from this post onto a different computer than the one it was created on, and had a file permissions problem. I was able to resolve this by looking at the file info and granting Read & Write permission to all users. I don't know if this will help anyone having a similar issue, but just in case…



One thing I am curious about: The option to Use Blender's Native Baker… for what kinds of animations would it be better to use the native baker instead of the B4W one? Or should I just always try the B4W one first and only resort to the native one as a fallback if I have a problem?
Thanks
31 January 2016 06:00
@cloudou You're welcome. Good luck!

Oh, and by the way, the "hand-off" technique works well when the empties are following Curve or Path objects too - like if you need the Camera to travel on a specific course.



follow_path_and_track_empty.blend
31 January 2016 04:14
I have a simple mesh with a simple rig. It animates fine within Blender, but when I export it to Blend4Web it stretches in an unpredictable and awkward way.

Here is what it looks like in Blender:


Here is what is happening in Blend4Web:


b4w_armature_deform.blend

Can someone please tell me what I've done wrong? Thanks.