I'm using the command below on an open3d() object to create a shaded cube. Changes to myScalingFactor do not effect changes in the size of the cube. What is the correct approach? Mark shade3d(translate3d(cube3d(identityMatrix() * myScalingFactor),-6,1,-1),col="green", alpha = 0.2) -- Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129 Work, & Mobile & VoiceMail (317) 663-0513 Home (no voice mail please)
Mark Kimpel wrote:> I'm using the command below on an open3d() object to create a shaded > cube. Changes to myScalingFactor do not effect changes in the size of > the cube. What is the correct approach? Mark > > shade3d(translate3d(cube3d(identityMatrix() * > myScalingFactor),-6,1,-1),col="green", alpha = 0.2) > >Homogeneous coordinates are strange. Your identityMatrix() * myScalingFactor produces a matrix that has the same effect as not multiplying. You need scaleMatrix(myScalingFactor, myScalingFactor, myScalingFactor) to get a size change. Duncan Murdoch
Mark Kimpel <mwkimpel <at> gmail.com> writes:> > I'm using the command below on an open3d() object to create a shaded > cube. Changes to myScalingFactor do not effect changes in the size of > the cube. What is the correct approach? Markhow about scale3d() ? shade3d(translate3d(scale3d(cube3d(),5,5,5),-6,1,-1),col="blue", alpha = 0.2) shade3d(translate3d(cube3d(),-6,1,-1),col="green", alpha = 0.2) shade3d(translate3d(scale3d(cube3d(),10,10,10),-6,1,-1),col="red", alpha = 0.2)