Author Topic: Polyline in software-renderer  (Read 631 times)

Offline ecm

  • byte
  • *
  • Posts: 1
    • View Profile
Polyline in software-renderer
« on: February 19, 2016, 02:18:46 pm »
Hi all,

I know that Polyline works in OpenGL, but I do not get any results with the software-renderer. Any workaround/fixes?
« Last Edit: February 19, 2016, 02:29:49 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Polyline in software-renderer
« Reply #1 on: February 19, 2016, 02:29:37 pm »
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.

Offline AGP

  • quad
  • ******
  • Posts: 1519
    • View Profile
Re: Polyline in software-renderer
« Reply #2 on: February 19, 2016, 08:39:10 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Polyline in software-renderer
« Reply #3 on: February 19, 2016, 08:48:43 pm »
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.