View source: R/save_multipolygonz_to_obj.R
save_multipolygonz_to_obj | R Documentation |
Converts MULTIPOLYGON Z features into a 3D OBJ model
save_multipolygonz_to_obj(sfobj, filename, swap_yz = FALSE)
sfobj |
sf object with MULTIPOLYGON Z geometry, |
filename |
Filename of the OBJ to save the 3D model to. |
swap_yz |
Default 'TRUE'., Whether to swap and Y and Z axes. (Y axis is vertical in rayshader coordinates, but data is often provided with Z being vertical). |
#Convert the built-in Washington Monument MULTIPOLYGON Z data to an OBJ file
obj_temp = tempfile(fileext=".obk")
save_multipolygonz_to_obj(washington_monument_multipolygonz, obj_temp, swap_yz=TRUE)
#Render with rgl
rgl::open3d()
render_obj(filename=obj_temp, xyz=matrix(c(0,0,0),ncol=3), color="red")
render_camera(theta=30,phi=40)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.