Forum Replies Created
-
AuthorPosts
-
2023-05-08 at 9:07 am in reply to: VR Reticle Ray can’t be turned of when restarting XR Session #63589Thomas FabiniCustomer
Hi Alexander,
thank you very much – I am really glad it is fixable, because I wasn’t able to find any reasonable workaround for this.
Thomas FabiniCustomerHi Alexander,
Thanks a lot for looking into this.
Thomas FabiniCustomerThat’s one of workarounds in JS to compare two lists (arrays) .
That’s something I wasn’t currently aware of – thanks for the explanation.
Today I got the whole raycaster setup finally working. At the end things got funny when the raycaster hits rotated objects, specifically dynamically rotated ones, or child objects of rotated parents.
What worked was adding the rotation of the raycast target object to the normal direction while setting and getting all rotations in world space. What helped, too was setting child objects to the -y (as the default raycast) world orientation before parenting.There is still an issue which might relate to Euler rotations and gimble lock, in my setup I can work around it. When it gets to math and vector math my brain goes like “just keep looking for a solution – I’m taking a break “.
Thomas FabiniCustomerThank you very much for posting your setup…
nice setting the rotation only after the normals change, and setting the additional rotation after setting the direction to the pointer… Is it neccesary converting prevNormal to string before checking it against the current normal? Would checking array against array go wrong?
The setup I use was less slick and efficient, but from the basics pretty similar.
Today I took that into a separate testing scene it actually worked, but it really helped checking the setup against your approach and understanding it further.
The Raycaster seems rock solid, as far as I can tell, it returns definitely face normals unless “point” is checked. https://v3d.net/j2dAttachments:
You must be logged in to view attached files.Thomas FabiniCustomerI realized that right after sending the post, obviously… duh.
It works flawlessly and beautiful, definitely face normals – your solution is based on puzzles I assume?I’m trying to achieve similar features, only not raycasting from camera / mouse but cast from an object and based on it’s direction in 3D space, and besides maybe some modifications to the cursor based on the uv coordinates returned by the raycaster.
Anyways – your suggestions and findings lead to the conclusion it’s possible, even with puzzles.
Thomas FabiniCustomerHi kdv,
with your recent post I realized some serious errors in my setup – first one that I was feeding the raycaster the right object for the origin of the raycast, but a direction vector in world coordinates [0,1,0] which does cast, but always in y+ without rotating with the object…
So there’s that. Your info regarding the default raycast direction proved useful because that’s what it did when i fed the object’s direction, casting in y-.
About the point option, I’ve had it off (expecting face normals, instead a single point in space) an on, too – but with the current setup it’s really hard to tell the difference.I will need to do some isolated testing next, take the raycaster features out of the current vr setup and check the basics in a simple test scene.
Thanks again for your hints!
Thomas FabiniCustomerHi kdv,
thank you very much for your quick answer, right on spot…
Set object direction – for unknown reasons I missed that one. It does exactly the conversion I’m looking for. But with some preliminary testing I assume the normal returned by the raycaster puzzle to be the vector of the object orientation – the aligned object orientates spherical toward the center of the object instead of aligning with its surface, it seems.I’ll try to go with your second suggestion and use the face normals from the api raycaster – besides that one seems to return more data – like the coordinates for a second uv set and pretty usefull stuff.
Anyways, thank you for pointing me in the right direction.
ThomasThomas FabiniCustomerHi Alexander,
thank you very much for your reply.
I think it’d be awesome if Verge3D could handle this kind of collisions in the near or further future…I have tested the room positioning mode, only to learn that the Quest 2 ignores completely which mode I choose. As far as I get it, it knows only two modes: “Roomscale boundary” and “Stationary boundary” of which the user has to choose one when using the headset. I assume these correspond with “room” and “sitting or standing”. The Quest 2 seems to ignore these settings in the WebXR app and goes with the internal setting.
Anyway, I couldn’t match probably the VR and real world space unless we rent a stadium or a larger hall :) . That’s why I added the controls for moving and rotation, while having the possibility to still walk physically within the defined boundaries.
For now I’m going down the road where I let the physics engine do the heavy lifting and push the entire scene farther when the user hits the walls. In a test setup, against my initial expectations the frame rate didn’t change at all when these collision occurred. But it is still unclear if it’s a real solution to the problem.
Anyways, I’d love to hear if you are implementing anything pointed in this direction or have any other suggestions.
Thanks,
ThomasThomas FabiniCustomerHi Yuri,
thanks for your fast reply. Since you mentioned Blockly – it appears there are users debating about local variables, or some plugin for local vars… Maybe it’s a feature that will make its appearance in time with Blockly evolving.
Until then I guess it’s all about variable and procedure naming discipline in Puzzles…
Thanks,
ThomasThomas FabiniCustomerThank you and the team very much for this new version and all the hard work you put into it!
The VR Demo is great, excellent display of how simple VR can be set up within Verge3D, I personally think that’s a great starting point to take projects further.
Allthough I downloaded 4.3 a soon as it was released, I hadn’t had yet the chance to dive into the latest addition (new VR puzzles) and OIT, beside a quick spin. Overall very cool additions, in my opinion all in the right spot.Thomas FabiniCustomerI assume then I only found the part in the code where it affects all collision bodies together, not just the meshes…
I guess it would be great if the devs could patch the output for the physics puzzles for collision meshes to have zero margins in a future version. Since primitives (and static bodies, as you stated) already are set up that way.
Including a puzzle for margin settings would be another option, although I didn’t come across a specific scenario where I would want a non-zero margin. At least not yet.
Thomas FabiniCustomerHi kdv,
when I tested your second variant, setting the zero margin for both, meshes and primitives seemed to affect collisions primitives in a negative way – meaning that physics objects with those collision primitives would sometimes fall through the floor while collision meshes where ok. Did you encounter this behavior, too?It’s why I went with your first variant, the patched zero margin setting for mesh collision bodies before they are generated.
Thomas FabiniCustomerYes, nice. Exactly that specific setting I went almost crazy looking for…
If i had known it would magically appear today I might have burned less brain cells in the process…Thomas FabiniCustomerNice find, thanks for having a look at this.
Hope the devs might take a closer look, too.I’ve ran into these issues mainly with detecting collisions (“detect collision of”) to trigger further actions. They where triggering before the collision bodies where touching. So it was less about the visible margin around physics bodies which I observed only after.
I’ll run some tests, I strongly assume the detection in between mesh collision objects will be more precise which the modified margin.
Thomas FabiniCustomerHi kdv,
since you patched puzzles.min.js I assume you modified ammo.js rigid body initialization parameters in the methods which are used for the js output of the puzzles.
Since I’m less of a developer – is geometry.setMargin(0) a possible solution to the problem (which could make it to a new version of Verge3D) or rather a quick fix?
-
AuthorPosts