After a lot of testing and reading the manuals, I think I came pretty close to what I wanted (code below). But some Cartesian axes do not appear. I placed each axis separately and the corners where the raster images coincide overlapping the axes. The others have no problems. Many thanks, Cleber ###################### library( rgl ); library( grid ); library( jpeg ) Rlogo <- "C:/R/doc/html/logo.jpg" logo <- readJPEG( Rlogo ) open3d( ); view3d( theta=300, phi=15, zoom=1.2 ) show2d({ par(mar=c(0,0,0,0)); grid.raster(logo,0.5,0.5,.80,.80,"center")}, face="xx", rev=1) show2d({ par(mar=c(0,0,0,0)); grid.raster(logo,0.5,0.5,.80,.80,"center")}, face="y-", rev=1) show2d({ par(mar=c(0,0,0,0)); grid.raster(logo,0.5,0.5,.80,.80,"center")}, face="z-") box3d( floating=NA? ) axes3d( c("x","x-+","x+-","y","y++","z","z--","z++"), tick=FALSE, labels=FALSE, expand=1.1 ) Em 30/10/2021 18:34, Duncan Murdoch escreveu:> On 30/10/2021 3:06 p.m., Cleber Borges via R-help wrote: >> ??library( jpeg ); ? library( rgl ); library( grid ) >> ? ?logo <- readJPEG( Rlogo ) >> >> ? ?x <- seq( 0,1,len=10 ) >> >> ? ?open3d() >> >> ? ?plot3d( x, x, x, type='n' ) >> >> ? ? show2d({ >> ? ? par(mar=c(0,0,0,0)) >> ? ? grid.raster( logo, x=0, width=1, y=0 ) >> ? ? }) > > > That's close; the only change I'd make is to the location: > > library( jpeg );?? library( rgl );? library( grid ) > ? logo <- readJPEG( Rlogo ) > > ? x <- seq( 0,1,len=10 ) > > ? open3d() > > ? plot3d( x, x, x, type='n' ) > > ?? show2d({ > ?? par(mar=c(0,0,0,0)) > ?? grid.raster( logo, x=0.5, width=1, y=0.5 ) > ?? }) > > Duncan Murdoch-- Este email foi escaneado pelo Avast antiv?rus. https://www.avast.com/antivirus
On 30/10/2021 5:48 p.m., Cleber Borges via R-help wrote:> After a lot of testing and reading the manuals, I think I came pretty > close to what I wanted (code below). > > But some Cartesian axes do not appear. > > I placed each axis separately and the corners where the raster images > coincide overlapping the axes. The others have no problems. > > > Many thanks, > > Cleber > > ###################### > > > library( rgl ); library( grid ); library( jpeg ) > > Rlogo <- "C:/R/doc/html/logo.jpg"That won't work on most systems. Please use something like Rlogo <- file.path(R.home(), "doc/html/logo.jpg")> logo <- readJPEG( Rlogo ) > > open3d( ); view3d( theta=300, phi=15, zoom=1.2 ) > > show2d({ par(mar=c(0,0,0,0)); > grid.raster(logo,0.5,0.5,.80,.80,"center")}, face="xx", rev=1) > show2d({ par(mar=c(0,0,0,0)); > grid.raster(logo,0.5,0.5,.80,.80,"center")}, face="y-", rev=1) > show2d({ par(mar=c(0,0,0,0)); > grid.raster(logo,0.5,0.5,.80,.80,"center")}, face="z-") > > box3d( floating=NA? )I don't think that has ever worked. "floating=NA" is a special value that means something in mtext3d() and related function, but it's not a legal value for floating in general.> axes3d( c("x","x-+","x+-","y","y++","z","z--","z++"), tick=FALSE, > labels=FALSE, expand=1.1 ) >I don't understand what you are trying to accomplish with this. There are 12 possible locations for axes; this draws 7 of them (since "z" and "z--" mean the same thing). Maybe this is why you aren't seeing some axes? Another possibility is "z-fighting". If you try to draw two 3D objects at the exact same location, only one will be displayed, and it's hard to predict which. Rounding error sometimes goes one way, sometimes the other. You can mitigate this by using the "polygon_offset = 1" material property on the polygons drawn by show2d(). Duncan Murdoch