On 11-06-18 3:47 PM, Fernando (Est - UnB) wrote:
Hi,

I'm new here.

This question concerns the package rgl.

Is it possible to change the colour of a set of points drawn with
plot3d /without/ removing them from the scene?

No, you can't modify objects other than by removing and recreating them.


The idea is to create a presentation of a clustering algorithm, step
by step, representing the currently assigned cluster by a colour.
Removing all the points with "rgl.pop" and replotting them at each
step works, but is kinda slow...

If you do it this way:

# plot the points, and save the id in pointsID

par3d(skipRedraw=TRUE)
rgl.pop(pointsID)
pointsID <- points3d(  ...  ) # plot the points again
par3d(skipRedraw=FALSE)

it will go faster, and appear to the viewer as though the colour just changed, with no removal of points.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to