简体   繁体   中英

Can't covisualise objects in same plot using plot3d()

Normally, this is fairly straight forward to acheive, however it is not working for.obj files I have read into R. One plot simply overwrites the preceding plot. Here is the code:

#read .obj files into R
fillskel_dnp=read.neuron("C:\\Users\\usr\\Dropbox\\WRITE.NEURON\\FILL TRACE\\DNP.obj")
fillskel=read.neuron("C:\\Users\\usr\\Dropbox\\WRITE.NEURON\\FILL TRACE\\fillobjnew.obj")

#process .obj files
fillskel.hbum=xform_brain(fillskel, reference = 'JRCFIB2018F', sample=T1, via=JFRC2)
fillskel.hbum_dnp=xform_brain(fillskel_dnp, reference = 'JRCFIB2018F', sample=JRC2018U, via=JFRC2)

#plot
open3d()
plot3d(fillskel.hbum, type='wire', col='black', lwd=3)
plot3d(fillskel.hbum_dnp,type='wire', col='Red', lwd=3)

Any help would be greatly appreciated!

Generally speaking plot3d clears the window (or moves to the next frame) before plotting. If you don't want that to happen, use the add = TRUE argument, ie your last commands should be

#plot
open3d()
plot3d(fillskel.hbum, type='wire', col='black', lwd=3)
plot3d(fillskel.hbum_dnp,type='wire', col='Red', lwd=3, add = TRUE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM