Forum Replies Created
-
AuthorPosts
-
jemCustomer
@hoody, if it were only that simple…
The mapping node in the Blender shader does not accept arguments for location, rotation, or scale. You must transform the vector from the UV map node before it is sent into the mapping nodes. You can use some math nodes to shift and scale the vector. Math nodes will accept input from values nodes. The basic process is:
1. Separate the vector into XYZ components
2. Transform the XYZ components
3. Combine the XYZ components into a vector
4. Pipe vector into the mapping node.I didn’t have an example on hand with your requirements on hand, but I did build a scene where I had to rotate a texture. Here is the node set up for that. Scaling and shifting would be easier. Your requirements wouldn’t require any trigonometry. Maybe someone else on the board has a better node setup for you.
Jeremy Wernick
jemCustomer@mugga, the easiest way to manage clones is to maintain their names on a list. You can then write a function to delete all or some of the clones.
There is a problem with your puzzles. You are cloning an object, but you are not recording the cloned object’s name anywhere. Without the clone’s name, you will struggle to delete it.
The clone object puzzle is a function that returns the name of the new cloned object. I suggest that you assign the result of the “clone object” puzzle to a local variable, add that variable to a list for later use, and then set the cloned objects position.
You can use a custom JS function to easily delete the clones. See:
Jeremy Wernick
jemCustomer@mugga, I think that clones are placed with respect to their origin. Are the origins of your cloned objects at their center? Perhaps, they were modeled in Blender or 3ds with and offset relative to their own origins?
Jeremy Wernick
jemCustomer@chidu, my AR scene has 21,000 tris. The bin.xz file is about 1MB. I have found through trial-and-error that I must keep the scene data simple. This includes meshes, textures, and shaders. I have a few textures files, none are larger than 1024×1024. I also try to keep my shaders simple. My goal is to limit the load on the GPU. The Snapdragon 855 on the Tab S5 does not seem to have any problem with AR scenes of this size.
If you are trying to get building-scale AR to work, you are attempting something that I have not. All of my AR work has been human-scale or smaller. I wonder how well the Google and Apple AR sub-systems are at anchorless AR environment mapping at such a large scale? Have you tried to get a very simple scene to function at building-scale? If it were my project, I would try something simple like sticking a few default cubes to the font of a large building and testing if Google AR Services can manage the markerless tracking at that scale and distance.
Good luck.Jeremy Wernick
jemCustomer@vincent, I have been able to get the whole AR stack (Google AR Services, Chrome, and Verge3D) working on several devices. I have run it on a Pixel 3 XL and a Pixel 2. By far, the best experience that I have experienced is on a 2019 Samsung Galaxy Tab S6. Admittedly, the Tab S6 is a pricey device, but the Pixels can be purchased used for not too much. I expect the prices for the Pixel 3’s to drop after Google introduces the Pixel 4 in two weeks.
It seems that phone OEMs will be certifying new devices to work with
Google Play Services for AR, but I would not expect the OEMs to backport support for legacy phones.Jeremy Wernick
jemCustomerHi Yuri,
This is an exciting new feature. The ability to call the puzzle functions from the web page or other JS code is especially interesting to me. I have to do this in all of my projects today. Before this enhancement, my implementation of this functionality was a bit of a hack.
I look forward to using this new clean approach. Thank you.Jeremy Wernick
jemCustomerSmaller and faster scenes! Always good. Thanks Soft8soft team!
Jeremy Wernick
2019-09-23 at 7:27 pm in reply to: Cannot Specify the imageURL for the SimplePreloader in 2.15.0-pre2 #19203jemCustomerHi Alexander, I was able to get my logo to work using your CSS suggestion. Thank you for the very quick fix!
Jeremy Wernick
jemCustomerIt may seem like a small thing, but I do appreciate the extend and clip options for the Blender textures. I was running into issues with this recently.
I am interested to see how access to the source code for those selected classes work. I am downloading it now…
Thanks Soft8soft teamJeremy Wernick
jemCustomerThis is an interesting feature request, but I was wondering if I could make this work today in 2.14? We could write a simple dispatching function in the ExternalInterface. It would take two arguments, the name of the function to be called and the arguments to pass on to that function. It would look something like this:
app.ExternalInterface.procedureCaller = function(procName, argsString) { app.ExternalInterface[procName](JSON.parse(argsString)); }
For example, you could call it like this:
app.ExternalInterface.procedureCaller("myProcedure1","{'color':'red', 'shape':'sphere'}");
…but this does not work for ordinary procedure puzzles because their code is inside a closure and it is not accessible. However, this does work well for the “when called from JS as..” puzzle because those functions are published to the ExternalInterface.
I can use this technique if I make a wrapper for each of my procedure puzzles. The wrapper is a “when called from JS as..” puzzle and it calls the procedure puzzle (see screenshot). This is a little ugly, but it does work. If there is a way to access the ordinary procedure puzzles from the ExternalInterface we could avoid this two-step.
…and I used a JSON string argument to deal with the variable quantity of arguments that scalare mentioned in his post.
Jeremy Wernick
jemCustomerVery clever! There are a lot of nice touches in here. The scene has puzzle-driven motion, custom fonts, sounds, textures loaded on the fly, and more.
It looks like you minified all of the JS before publishing. Did you include the Verge3D engine file in the file minimization? I ask because your v3d.js file size is smaller than I have ever seen in a recent release of the Verge3D system. I never thought of doing that.
Great work. Thank you for sharing.
Jeremy Wernick
jemCustomerOops. I was editing my previous post in an attempt to fix the formatting of the JavaScript code and the forum software seems to have deleted the post. Apparently square brackets can cause issues. At risk of double posting, here is my original post that Yuri responded to (with the JS code now included as an image).
———————-
Hi Yuri,
I do not wish to complicate this topic, but I do wonder if the remove() function is sufficient to completely remove an object and its data from memory? There are a few threads about this on Stack Exchange and a page in the Three documentation (https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). I wrote a function to do this that removes the object from the scene and also disposes of the data. My hope was this approach would free up memory better than using remove() alone. What is the opinion of the Soft8soft team?
Thank you.Jeremy Wernick
jemCustomerIf I can add my opinion here, I suggest that extra care should be applied in keeping your models as low-poly as possible. When using AR, this is the path to success. Models that originate from a CAD system are notorious for being too detailed. In my tests with AR, overly detailed CAD models cause the AR system on the phone to jitter. I don’t think that this issue is unique to Verge3D. AR is very CPU and GPU intensive, and mobile phones have very limited resources.
Jeremy Wernick
jemCustomerHi Yuri,
I do not wish to complicate this topic, but I do wonder if the remove() function is sufficient to completely remove an object and its data from memory? There are a few threads about this on Stack Exchange and a page in the Three documentation (https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). I wrote a function to do this that removes the object from the scene and also disposes of the data. My hope was this approach would free up memory better than using remove() alone. What is the opinion of the Soft8soft team?
Thank you.//A function to fully dispose of objects. //This is useful to dispose of cloned objects. app.ExternalInterface.disposeOfObjects = function (objects) { for (var i = 0; i < objects.length; i++) { if (typeof objects !== 'undefined') { var meshToBeDeleted = app.scene.getObjectByName(objects); app.scene.remove(meshToBeDeleted); meshToBeDeleted.geometry.dispose(); meshToBeDeleted.material.dispose(); meshToBeDeleted = undefined; } } };
Jeremy Wernick
jemCustomer@gliftek, I often need this sort of helper function in my applications. When I do need this sort of solution, I use the technique that Yuri has described. I write JS code, wrap it in a function, and call that function from my puzzles. This technique is the #2 method from the documentation. https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html#Method_2_Versatile
However, I think the example from the documentation can be improved. We have a newer JS puzzle that takes parameters accepts a return value from a JS helper function. Here is Yuri’s code using this technique:
function prepareExternalInterface(app) { app.ExternalInterface.getFirstChild = function(parentObjectName) { var object = app.scene.getObjectByName(parentObjectName); return object.children[0].name; } }
Jeremy Wernick
-
AuthorPosts