DefaultLineShader crossSection?

Have jReality programming problems or questions? Post them here.
Post Reply
STRESS
Posts: 141
Joined: Mon 19. Jan 2009, 12:10

DefaultLineShader crossSection?

Post by STRESS » Tue 22. Jun 2010, 16:08

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 :)

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Re: DefaultLineShader crossSection?

Post by gunn » Wed 23. Jun 2010, 18:58

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.
jReality core developer

Post Reply