Hi,
I'm having a lot of fun with rayrender.
However, since I am creating my meshes in R using a combination of rgl and Rvcg, I was wondering if there was a way to bypass writing an .OBJ file to disk to subsequently have rayrender load it in the scene. Sort of what mesh2ray does, but not just rendering cubes, rather the whole mesh and its faces.
I know that you can easily get vertex coordinates, faces and normals from a shape3d object, but if I understand correctly non-primitive shapes are only loaded in the scene through Rcpp via TinyObjLoader.
The only alternative I could think of was, in the spirit of mesh2ray, loading every triangle as a separate object via add_object(triangle()), using vertices and normals from the shade3d object.
But this is horribly slow using a for loop - so much that it makes no sense as an alternative to writing and reading a big .OBJ file - and, since it has to call add_object() every time, I'm not sure whether it can be vectorised.
Do you have any other suggestions?
Hi, I'm having a lot of fun with
rayrender
. However, since I am creating my meshes in R using a combination ofrgl
andRvcg
, I was wondering if there was a way to bypass writing an .OBJ file to disk to subsequently haverayrender
load it in the scene. Sort of what mesh2ray does, but not just rendering cubes, rather the whole mesh and its faces. I know that you can easily get vertex coordinates, faces and normals from ashape3d
object, but if I understand correctly non-primitive shapes are only loaded in the scene throughRcpp
viaTinyObjLoader
. The only alternative I could think of was, in the spirit ofmesh2ray
, loading every triangle as a separate object viaadd_object(triangle())
, using vertices and normals from the shade3d object. But this is horribly slow using a for loop - so much that it makes no sense as an alternative to writing and reading a big .OBJ file - and, since it has to calladd_object()
every time, I'm not sure whether it can be vectorised. Do you have any other suggestions?