Skip to content

transparency and rgl parameters in 3D plots (plotEqn3d) #37

Description

@friendly

In conjunction with a problem with ugly rendering of 2D ellipses in 3D heplots, Duncan Murdock suggested a solution using a new (to me) rgl property: mask_depth

https://stackoverflow.com/questions/64486375/rgl-how-to-avoid-moire-effect-in-transparent-3d-ellipsoids/64490059

In plotEqn3d, we use alpha=1 by default, so this problem doesn't arise, yet the result of showing regression planes is not very insightful. One can only see the non-occluded portions of the planes.

I've implemented Duncan's suggestion in plotEqn3d() on github, and tested it under different values of alpha. My question is: Should I change the default from alpha=1 to something alpha<1 ? Your thoughts?
[This also affects regec3d where the default results are often uglier]

Extending the example:

> # three consistent equations in three unknowns
> A <- matrix(c(13, -4, 2, -4, 11, -2, 2, -2, 8), 3,3)
> b <- c(1,2,4)
> plotEqn3d(A,b)
> plotEqn(A, b, alpha=0.5)
> plotEqn(A, b, alpha=0.8)

The differences among these are best seen in plots you can rotate.
In static views, I get:

alpha=1
plotEqn3d-opaque
alpha=0.5
plotEqn3d-trans-5
alpha=0.8
plotEqn3d-trans-8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions