Forum Replies Created
-
AuthorPosts
-
elkCustomer
Did not see your last post before replying. Good ting you figured it out
elkCustomerhmm, the blueTex.jpg is only in the folder, only set up the redText.jpg in the material in blender. I can´t think of a reason why the UI on top should matter, as the actual “call” for the texture replacement comes from puzzles so should have the have the same frame of refferance…!? Unless ofcource your UI it self if the problem not the call, did you check if you make i t into the event trigger, just try with a debug log puzzle right before the replace call for instance …
elkCustomerThis seems to be working for me, see attached image.
bothe of my textures are in the applications folder so ” ./<filename> “. I can see you dont have an extention on your filename, might be a problem…
elkCustomerAhhh. Nice, was thinking that would only work with html events, but this is also built to behave consistently with the events of the Event category puzzles also then ?
elkCustomerIt is under animations -> “play animation” puzzle probably the one you are already using, but you need to click on the little blue cog icon and enable advanced playback options to see the from, to, revers and other options options.
elkCustomerAlso just realized there is a “make list from text <puzzle> with delimiter <puzzle>” puzzle. You should be able to then condense (concatinate) the entire array or JSON into a coma separated list (as one singe string/variable) for instance and pass that around as one variable either through JS calls or the load data for instance, if you got the data in a separate file.
elkCustomerHi guys.
I had a poke around in the code (still got a lot to learn about the verg3d/three.js codebase tho) but I made this little “snippet” that atleast work in the console with the app “class” exposed in Chrome and FF on my PC, did not test it in runCode tho;
app.scene.getObjectByName(“Icosphere.001”).material = app.materials.find(x => x.name === “Material.003”);
Replace “Icosphere.001” with your objects name, and “Material.003” with the material you want it to change too. You could just code a loop around this if you got the objects and materials listed in an array or JSON file or whatever.
PS! The find method/function I just found on a quick search, and according to my findings it might be an EcmaScript6 thing, so might not be usable everywhere. So this is just to maybe point you in the right direction, and I suspect the Verge3D has a thing or to to correct me on for this single line of code Atleast there should be a better way to get the material by name I suspect.
I could not see the reason for getting it through the puzzle system tho, maybe elaborate on what you want to do, or why you need it to work a specific way.
elkCustomerelkCustomerHappy bithday Yuri!
elkCustomerYeah, sort of. If you are “within” the collision mesh, the camera will be put back onto the last known good position that was still above the collision mesh/material, or something like that, if it does not find the collision mesh/material under the camera (on a frame by frame basis I would think). The problem is when your collision mesh/material is two layers “thick”, then it will find the first floor once you go of the edge of the second floor, bacause then it will not stop you at the edge, but “snap” you down to the first floor. That is why i suggested limiting the raycast to a customizable distance, that way the first floor would not me seen by the raycast from the extra distance down to the first floor, and problem should be resolved.
In some early 3D FPS games before physics engines and stuff, you can see this kind of limitations in map design, where you might be able to walk up and down slopes, but you would not have floors overlapping. If I’m not mistaken they used something similar to hightmaps to determine how high in 3D space a character walking on the floor would be at any point on the map, and they could only use one 2D image for that so no overlapping walkable areas. Thankfully those days are gone ;)
also i made this a couple of days ago for another question here, this demonstrates it if you go up the two small slopes her and try to go of the edge towards the first floor;
And maybe we should take this to another thread if you have further questions, I only mentioned it here becuse this is where I first suggested the “feature”
elkCustomerRaycast is when you project a ray from a point in 3D space and giving it a direction vector from that point to see what objects it intersects with, for instance creating a ray from the center of your camera and towards the position of your mouse(recalculated in scene space) so you can trigger a highlighting for the hit object for instance. This can usually be set to return either the first or a list of object hit within a set distance from the originating point, along with some other information about the hit.
Nice sketchbook btw, you really got some drawing skills
elkCustomerYou could also then set up the first custom tab to be you own “init afte sceneload” in a sense then, assuming the tabs will always be processed from left to right … !?
elkCustomerThanks for clearifying that Yuri. So then I would not be possible to do the initialization with the materials in the init tab because the scene data is not loaded yet. But based on those constraints you might be able to do some other initialization in the init tab, other than the obveiouse initialization puzzles.
2019-03-20 at 6:18 pm in reply to: Physics – creating solid walls with camera as first-person view. #13071elkCustomerNo problem. Glad you found it useful
elkCustomerYes, anything that is just straight puzzles that is not in an event handler or anything should just run straight away. The event handler in a sense also gets run straight away, but that will only registrer the event handler so the javascript under the hood can call it on events in the browser.
That being said I am not sure of the order if you put more lose puzzles in a tab, that is why I have only been using one connected block of these together. The more correct thing would probably be to do that initialisation in the default init tab.
This is mostly based on my assumptions tho, and might be putting it oversimplifide but i think this is the basis of it, please correct me if I missed something here Verge3D team :)
-
AuthorPosts