tylermorganwall / rayvertex

3D Software Rasterizer for R
https://www.rayvertex.com
65 stars 2 forks source link

Regression in importing textured meshes from Wavefront OBJ files #16

Closed trevorld closed 8 months ago

trevorld commented 8 months ago

I received an e-mail from Prof. Ripley today informing me that the newest release of {rayvertex} is triggering a CRAN check ERROR in {piecepackr} when running the \donttest{} examples. A simplified version of the \donttest{} example which worked in earlier versions of {rayvertex}:

library("piecepackr")
envir <- game_systems("sans3d", round=TRUE)
f <- save_piece_obj(piece_side = "tile_back", x = 1.5, y = 1.5, suit = 1, rank = 1,
                    cfg = envir$piecepack)

# import/render Wavefront OBJ file in {rayvertex}
library("rayvertex")
tile <- obj_mesh(f$obj)
table <- sphere_mesh(c(0, 0, -1e3), radius=1e3, material = material_list(diffuse="grey40"))
scene <- add_shape(table, tile)
rasterize_scene(scene, filename = "rayvertex_bug.png",
                lookat = c(4.5, 4, 0), lookfrom=c(4.5, -16, 20),
                light_info = directional_light(c(5, -7, 7), intensity = 2.5))
Error: Number of items is not equal to specified material length.

Enter a frame number, or 0 to exit   

1: obj_mesh(f$obj)
2: objects.R#732: read_obj(filename, materialspath)
3: readobj.R#29: load_obj(filename, dir)

This is a different bug from #9

tylermorganwall commented 8 months ago

It appears to be fixed in the latest commit (35e938e55d964f5bab13959b607835b6f9d8b4ab)--see if it's fixed on your end. If so, I'll push an update to the CRAN with the latest version.

trevorld commented 8 months ago

see if it's fixed on your end

I confirm that this fixes it on my end.

If so, I'll push an update to the CRAN with the latest version.

Thanks!