Positional Audio In Three JS - HRTF's - three.js

I just wanted to check - can three.js use HRTF's in creating positional audio. The documentation (https://threejs.org/docs/#api/en/audio/PositionalAudio) says it uses web Audio API (https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics) - in which you can use HRTFs as your panner model (const pannerModel = 'HRTF';), but three.js doesn't say anywhere that you can use an HRTF within it.
Thanks!

THREE.PositionalAudio uses HRTF by default. If you want to change it, you can always do this:
positionalAudio.panner.panningModel = 'equalpower';
three.js R110

Related

Extracting image dimensions in the background with Shrine

I have set up direct uploads to S3 with Shrine. This works great. Among others, I have the following plugins enabled:
Shrine.plugin :backgrounding
Shrine.plugin :store_dimensions
Shrine.plugin :restore_cached_data
Correct me if I'm wrong but image dimensions extraction appears to be done synchronously. If I let the user bulk upload images via Uppy and then persist them all, this seems to be taking a long time.
What I'd like to do is perform image dimensions extraction asynchronously - I don't need the dimensions available for the cached file. If possible, I'd like to do that in the background when the file gets promoted to the store. Is there a way to do it?
The way I got this to work is by making use of :refresh_metadata plugin, instead of :restore_cached_data which I used originally. Thanks to Janko for pointing me in the right direction.
Reading into the source code provided some useful insights. :store_dimensions plugin by itself doesn't extract dimensions - it adds width and height to the metadata hash so that when Shrine's base class requests metadata, they get extracted too.
By using :restore_cached_data, this was being done on every assignment. :restore_cached_data uses :refresh_metadata internally so we can use that knowledge to only call it when the file is promoted to the store.
I have :backgrounding and :store_dimensions set up in the initializer so the final uploader can be simplified to this:
class ImageUploader < Shrine
plugin :refresh_metadata
plugin :processing
process(:store) do |io, context|
io.refresh_metadata!(context)
io
end
end
This way persisting data we get from Uppy is super fast and we let the background job extract dimensions when the file is promoted to the store, so they can be used later.
Finally, should you have questions related to Shrine, I highly recommend its dedicated Google Group. Kudos to Janko for not only creating an amazing piece of software (seriously, go read the source), but also for his dedication to supporting the community.

How do I access this variable from a different blueprint?

I have found loads of stuff like this on the Internet, but none of it is helping me and I would just love a direct response for this situation.
I have a text UI for my ammo which I simply want to access from the blueprint that handles firing. The text UI has a variable associated with it (At least, I assume this is my text UI):
But for unknown reasons won't let me make it public. That doesn't seem to matter though, because I have experimented with other public variables and I can't access them from my blueprint either!
How can I get access to my variable here so I can do what I wish?
I found your other questions so I assume you're using 4.12, like myself.
So I can use the variable declared in UMG as follows:
Step 1, make a text block, enable it as Is Variable:
Step 2, check it from the Graph part:
Step 3, some other Blueprint, use it:

Bing Maps V8 - How can I rotate map in Bird's Eye view?

I am upgrading from Bing Maps V7 to V8 and rotating the map from JS doesn't work anymore. I have been trying with this piece of code:
map.setView( { heading:90 } );
This works if I change the source URL for the map library to V7. And I see that the "setView" function and the "heading" option still exist in V8.
Here's an article about how to do it in V7:
https://alastaira.wordpress.com/2012/03/28/rotating-bing-maps/
Bing Maps V8 currently doesn't have Birdseye. A new birdseye experience is being introduced to V8 within the next few months. This new experience has a lot of new imagery which uses a different format from the old birdseye experience. Given that the imagery that is in V7 is very old and is a major point of DSAT, it was decided to hold off on adding birdseye to V8 until the next experience and data is available.
I did some more research and two undocumented things have changed.
map.setView() does not respond to a full options object anymore.
Example:
var options = this.map.getOptions();
options.heading = 90;
map.setView(options);
It now needs the heading and other changed fields manually specified to reflect any changes.
map.setView({heading: 90});
map.setView({heading: xx}) no longer accepts negative values as valid so you must manually submit heading values for any clockwise rotations so that it corresponds to the positive heading value.
Thus, map.setView({heading: -90}) was previously smart enough to know that is equivalent to map.setView({heading: 270}), but now must be submitted to the API as a positive value.
Similar to the first example, I have some legacy code for resetting the map back to original lat/lon and heading that now needs a second setView() call in order to update.
var options = this.map.getOptions();
options.zoom = this.initialZoom;
options.center = new Microsoft.Maps.Location(this.lat, this.lon);
options.heading = this.heading = 0;
this.map.setView(options);
this.map.setView({heading: this.heading});
Must call setView another time so that the new heading is actually applied.

Why Marmalade has so strange naming?

I've read some tutorial about Marmalade Framework. You know... it's totally awesome :)
For example:
// Creating an Image from a Web Based Image File:
CIwGameFile* image_file = new CIwGameFile();
image_file->Open( "http://site...../icon.gif", false, true );
image_file->Close();
// Now we will create a sprite to display our downloaded web image:
CIwGameBitmapSprite* test_sprite = new CIwGameBitmapSprite();
test_sprite->setImage( image );
test_sprite->setDestSize( image->getWidth(), image->getHeight() );
WHY?? Why the first methods have uppercase (Open, Close) name and the second ones in lowercase (setImage, getWidth)? Is there any common sense when they do that? Or Marmalade has SO aweful syntax in whole library?
IwGame uses first letter lower case for setters and getters
Marmalade uses Upper Camel case for all of it's methods (as far as I've seen). The methods you are talking about is not Marmalade's own API methods. These are IwGame engine's methods. Marmalade has no control on this.

How to add components in to an existing GUI created by guide?

I just created a GUI using guide in MATLAB for a small project I'm working on. I have amongst other things two text fields for from and to dates. Now I'd like to get rid of them and use a Java date select tool. Of course this is not possible using guide so I need to add them manually.
I've managed to get them to show up by putting this code into my Opening_Fcn,
uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
using UICOMPONENT.
But even though it shows up I can't access the date select's attributes, for example
get(handles.til2)
returns
??? Reference to non-existent field 'til2'.
How can I fix this?
Unless you edit the saved GUI figure, the basic handles structure will not include your new component by default.
One way to access you component is to store the handle via guidata, by adding the following to your opening function:
handles.til2 = uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
guidata(hObject,handles)
Functions that need to access the handle need the line
handles = guidata(hObject)
to return the full handles structure that includes the filed til2

Resources