Page 1 of 1

DefaultLineShader crossSection?

Posted: Tue 22. Jun 2010, 16:08
by STRESS
Just a quick question what is the purpose of setCrossSection in DefaultLineShader, the JAVADOC doesn't say anything about it. I guess I could look in the source code but I feel a bit lazy right now and it might not give me the right answer as well :)

Re: DefaultLineShader crossSection?

Posted: Wed 23. Jun 2010, 18:58
by gunn
By default, when you are drawing tubes in the line shader (setTubesDraw(true)), then these tubes will be drawn by default with a regular octagon as cross section. You may not have seen this octagon this since they are also drawn using smooth shading (though you can get change this via the setSmoothShading() method in DefaultRenderingHintsShader) ... anyway you can set this cross section to be something else by using the setCrossSection() method. The argument should be an array of points of the form (x,y,0) which should form a closed curve (that is, the last point should be equal to the first one) in the x-y plane... The curve is then moved around in 3-space to sweep out the tubes. I'm not sure what happens if the z-coordinate is not 0, or if the curve doesn't close up. Something presumably interesting and/or irritating.