Stingray Forum (Read Only)
Welcome to Autodesk’s Stingray Forums. Share your knowledge, ask questions, and explore popular Stingray topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VR teleport slope planes

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
Francisco_Penaloza
1304 Views, 10 Replies

VR teleport slope planes

Hello,

I am working on this VR presentation and the terrain (Street) is not flat, it has different slopes throughout and when I test the scene you can only teleport on the flat areas and not on the sloped areas.

 

Doing some research in some place mentioned that by default the teleportation will work only with upwards normals. but I don't know where I can find this code and how to change it to be able to teleport on these sloped areas.

thank you.

 

Fco.

10 REPLIES 10
Message 2 of 11

In the flow in functionality_teleport I check for a z normal for a flat surface. You can change that check to check against anything you like for teleportation. IE: check your road actor and only teleport on the road, check a material and only teleport there, etc ... or you can remove it and teleport anywhere. 

 

normalcheck.JPG

______________________________________
Dan Matlack
Senior Content Manager || Games Solutions
Autodesk, Inc.
Message 3 of 11
svaisanen
in reply to: dan.matlack

I think what you really might want to do here is to take the dot product of the surface normal where you want to teleport with the up vector and see if it's above some treshold value. 

Message 4 of 11

Hi,

I am back to this project.

Sadly I don't know what I am doing here, I searched for  the flow you mentioned, found that check normal for spawn location but don't know what to do.

I disconnected but then it does not teleport.

 

I can't even wrap my head around how to place my plane in that flow to check for it position???

usually I just click on the object, then right click on the flow screen and the unit is selected, in this case is not working.

There should be an easy way to do this, I am pretty sure I am not the only one who is not a programmer that will need to walk in none even terrain..

Your help is appreciated.

 

Fco.

 

Message 5 of 11

Hi, 

Did you find a solution for the problem yet?

I tried some of the previous suggestions but my lack of knowledge in programming seems to be in the way.

Can someone be a bit more specific with a workaround for this problem? 

Cheers

 

 

Message 6 of 11

Guys, I'm not really sure what your problem is? 

 

 

In the teleport flow there's Raycast node which gives you the unit, actor, normal etc. data of the location where the user is trying to teleport.

If you want to allow to teleport to a sloped surface you'll check the dot product of the normal at the teleport location with the up vector of the scene. 

 

For unit length vectors the dot product gives you the cosine of the angle between the vectors. 

 

Remember that cos 0 = 1 and cos 90 = 0, i.e. when the surface is parallel with "flat ground" cosine is 1

 

Find the attached flow. (which I didn't test 😉

 

HTH

 

teleport_to_slope.png

 

 

Message 7 of 11

@rafael.pimpao actually I just found a solution yesterday, to be precised it was 25 minutes before my presentation 😛

actually was not my solution but my Art Director, he has a background in programming so I guess that help him out to 'translate'  what @dan.matlack explained earlier.

Teleporttoanysurface.jpg

 

 

We just disconnect on the Check normal for spawn location the value  from Equal to the Bool input on Set Bool Variable.  Then we placed a true value there and now we can teleport anywhere that there is a Physical actor.  May not be perfect but it did the trick for us. What my Art director explained that the " ray cast was cheking for a normal value, and between Vector components and equal they just were a confirmation if that Vector was exitent. When we just place a true value, then it will accept that normal nomatter what.... I bet Dan will have a better explanation for this, but any ways for me it way beyound I can understand 😛

 

@svaisanen Thank you for your help, but maybe for you this seems like easy to resolve but again my brain is not wired as a programmer or someone who studied that. I just see colors and form 😛

appreciate your input any ways.


@svaisanen wrote:

Guys, I'm not really sure what your problem is? 

 

 

In the teleport flow there's Raycast node which gives you the unit, actor, normal etc. data of the location where the user is trying to teleport.

If you want to allow to teleport to a sloped surface you'll check the dot product of the normal at the teleport location with the up vector of the scene. 

 

For unit length vectors the dot product gives you the cosine of the angle between the vectors. 

 

Remember that cos 0 = 1 and cos 90 = 0, i.e. when the surface is parallel with "flat ground" cosine is 1

 

Find the attached flow. (which I didn't test 😉

 

HTH

 . 

 

 


Message 8 of 11

Hi Guys

 

Thank you for all the suggestions.

I tried them all and unfortunately none work. And I did test in several new files even with very simple geometry. It simply doesn't work unless is flat.

Out of curiosity any of you is using Oculus touch? Was this example only tested with the HTC Vive? Might be nothing but now I'm curious.

 

Cheers All

Message 9 of 11

@rafael.pimpao

For this project yes I was working with the HTC VIVE, never used the Oculus Riff. so things may be different.

BTW I am not using Stingray anymore, because I moved to Unreal.

 

Sorry, I can't help.

 

Message 10 of 11

Hi,

This solution worked for me before but in 2019 the functionality_teleport flow_editor is completely different. I need to be able to teleport to sloped surfaces in a project. How do you fix this in the updated version?

Message 11 of 11

Solved it. Had to brake a link between "Vector Components" and "Set Bool Variable".

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report