We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

jem

Forum Replies Created

Viewing 15 posts - 91 through 105 (of 173 total)
  • Author
    Posts
  • in reply to: Flexible Texture Width #20058
    jem
    Customer

    @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

    in reply to: Removing cloned geometry #20051
    jem
    Customer

    @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:

    How do I remove objects from scene

    Jeremy Wernick

    in reply to: Clones not on correct position #19999
    jem
    Customer

    @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

    in reply to: New Topic about Augmented Reality #19936
    jem
    Customer

    @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

    in reply to: New Topic about Augmented Reality #19864
    jem
    Customer

    @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

    in reply to: Dynamic calls to procedures #19666
    jem
    Customer

    Hi Yuri,
    This is an exciting new feature. The ability to call the puzzle functions from the web page or other JS code :good: 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

    in reply to: Verge3D 2.15 pre3 available! #19429
    jem
    Customer

    Smaller and faster scenes! Always good. :good: Thanks Soft8soft team!

    Jeremy Wernick

    jem
    Customer

    Hi Alexander, I was able to get my logo to work using your CSS suggestion. Thank you for the very quick fix!

    Jeremy Wernick

    in reply to: Verge3D 2.15 pre2 available! #19189
    jem
    Customer

    It 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 team :good:

    Jeremy Wernick

    in reply to: Dynamic calls to procedures #19026
    jem
    Customer

    This 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

    in reply to: mirror mirror on the wall #18720
    jem
    Customer

    Very 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. :good:

    Jeremy Wernick

    in reply to: How do I remove objects from scene #18535
    jem
    Customer

    Oops. 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

    in reply to: WEBXR AR with Animation #18532
    jem
    Customer

    If 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

    in reply to: How do I remove objects from scene #18531
    jem
    Customer

    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.

    	//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

    in reply to: Object's Child Or Parent? #18437
    jem
    Customer

    @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

Viewing 15 posts - 91 through 105 (of 173 total)