Keeping the same length when raycasting a line on bumpy ground?

   1567   6   0
User Avatar
Member
70 posts
Joined: March 2016
Offline
Hi,

When I am raycasting a line on the ground the arclen constantly changes.
It's micro-values at the moment, but it is a problem for the final thing I am working on.

The two points of the line are going to direct the wheels and I'll subdivide the line to get the center point.

This center point is then going to drive the body of the vehicle.

So when the arclen constantly changes, the vehicles body is wiggling a lot too…

Someone who knows a solution?
Edited by Klonkel - Feb. 22, 2019 03:08:10

Attachments:
Forum_Ray_Arclen.hip (259.4 KB)

https://www.youtube.com/@Klonkel
User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Hey Chris,

you could try a timeshift and freeze the raycasted line on one frame.

Cheers
CYTE
User Avatar
Member
70 posts
Joined: March 2016
Offline
Hi CYTE,,

But then the animation would be gone, or am I understanding you wrong?

Thanks,
Chris
https://www.youtube.com/@Klonkel
User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Hey Chris,

sry, I didn't take a look at your scene. I thought its some sort of path for the car. never mind…
User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Hey Chris,

I think the issue is created by the bumpiness of the terrain. this way the rays hit the ground on different elevation levels. this difference in elevation adds to the final arclen. maybe you could correct the length of the line after the raycast with a wrangler.

Cheers
CYTE
Edited by CYTE - Feb. 21, 2019 15:17:33
User Avatar
Member
70 posts
Joined: March 2016
Offline
Hi CYTE,

Yes that's something I have been thinking about too, but I can't come up with a solution in vex.

Thanks,
Chris
https://www.youtube.com/@Klonkel
User Avatar
Member
679 posts
Joined: Feb. 2017
Offline
Maybe just use a carve to cut the extra length equally from both sides.
  • Quick Links