Polyline in software-renderer

Started by ecm, February 19, 2016, 02:18:46 PM

Previous topic - Next topic

ecm

Hi all,

I know that Polyline works in OpenGL, but I do not get any results with the software-renderer. Any workaround/fixes?

EgonOlsen

No, it's not supported by the software renderer. Quote from the docs of the Polyline class:

Quote
This doesn't work for the software renderer.

You could try to implement your own solution by using http://www.jpct.net/doc/com/threed/jpct/Interact2D.html#project3D2D(com.threed.jpct.Camera, com.threed.jpct.FrameBuffer, com.threed.jpct.SimpleVector) and then draw the line via the normal Java2D methods on top of the rendered image, but this of course won't take the depth buffer into account and you would have to do the clipping at the near plane all by yourself.
What do you need this for? Maybe there's some other solution...

Edit: I fixed the thread's title, in case you are wondering why I edited your post.

AGP

Why not just implement the Java2D way for the software renderer, Egon? Isn't best to keep both renderers as close as possible? And the software renderer is such a nice feature of jpct, really. I wouldn't want it to become obsolete.

EgonOlsen

Because it would ignore the depth buffer. The software renderer has line drawing capabilities, but they aren't exposed because they are simple 2D lines with no culling, clipping or depth. I can put it on the TODO list, but not with top priority.