sanskriti sujoy
sanskriti sujoy

Reputation: 11

How to visualize a cylinder 3d data in rgl R?

I have a 3D (xyz) data of a cylinder from a laser scanner.Containing 201716 points.

x          y        z
-114.63    62.23    0.004
-114.748   62.297   0.061
-114.55    62.246   -0.046
-114.66    62.308   0.009
-114.744   62.356   0.068
-114.815   63.306   -0.017
-114.579   63.319   -0.104
-114.686   63.381   -0.048
-114.78    63.435   0.009
-98.459    59.892   2.489
-98.353    59.834   2.636
-98.323    59.881   2.954
-98.303    59.872   3.005
-98.281    59.86    3.053
-99.868    60.922   3.562
-100.037   61.053   4.284
-98.326    60.005   2.931
-98.33     60.009   2.981
-98.351    60.023   3.032
-98.286    59.988   3.13
-99.844    60.953   3.537

How can i visualize this 3D data using rgl in R?

Upvotes: 1

Views: 868

Answers (1)

user2554330
user2554330

Reputation: 44897

Put the data into a matrix d, with columns of x, y and z coordinates, and call points3d(d).

If you know more about the structure of your data you can probably do better. For example, you might be able to join pairs of points (using segments3d(d)) or triples of points (using triangles3d(d).) Both of those will look terrible if the data is not structured so that they make sense.

If you want to see a scale on the plot, finish by calling decorate3d() to add axes and scales.

Upvotes: 0

Related Questions