Filling in between x,y,z coodinates

2 views (last 30 days)
Kavish Ram
Kavish Ram on 25 Sep 2020
Commented: Walter Roberson on 26 Sep 2020
Hi,
I am trying to fill in the regions for x, y and z in scatter3. My goal is to show all the filled contour (with colormap jet) with each indivual axis. This will be used in a terrain mapping situation.
I have tried both fill and patch function but haven't been able to achieve any display. (apologize for the messy diagram).
Any help with be highly appreciated
My code is
x = DistanceX .* sin(AngleX) .* cos (pi);
y = DistanceY .* sin(AngleY) .* sin(pi);
z = DistanceZ .* cos(AngleZ);
figure;
hold on;
scatter3 (x,y,z);
line(x ,y,z, 'LineStyle', '-');
  3 Comments
Kavish Ram
Kavish Ram on 26 Sep 2020
Yeah, I was wondering that too. The distance and angle values are given to be by a LIDAR (scanner) and I have just used them with the equation to get xyz
Walter Roberson
Walter Roberson on 26 Sep 2020
It is an important concern for your purposes. The distance along one axes is noise compared to the other axes. Consider if you use traditional Euclidean sum-of-squares then 1e-13 squared is about 1e-26 which is well below eps of the x coordinates. Any attempt to find boundaries by triangular decomposition is doomed unless the calculation is very careful. The hypot() function call does take steps to correct for that but has its limits.
Note that the hold on before the 3d line call freezes the view so we only see 2d. You should view(3) and show us that.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!