tunabrain / tungsten

High performance physically based renderer in C++11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementation of cylinder primitive?

yudongqiu opened this issue · comments

Hi Mr. Bitterli,

I was introduced to your renderer by a friend, and was impressed by the result and performance. As I'm trying to render some molecular pictures, a "cylinder" geometry would be very helpful for showing chemical bonds. Without any knowledge of computer graphics, I read the implementation of other primitives in src/core/primitives and tried to implement the cylinder primitive by mimicking them. My first draft was able to compile, but the cylinder is not showing up in the rendered results, except some reflections on a sphere. I have very little understanding of how the rendering works, so many of the functions may be done terribly wrong. If you have a little time, could you please take a look at it? (https://github.com/yudongqiu/tungsten/blob/master/src/core/primitives/Cylinder.cpp)

Any hint on my mistakes, or references that could help me understanding it, would be greatly appreciated. It would be also great that if you think writing it from scratch is better than looking at mine. 😄 Thanks a lot!

Best,

Yudong Qiu

Hi Yudong,

Thanks for your efforts! I decided to implement a cylinder primitive (both with and without end caps). I just pushed it to the master branch.

Here is an example scene:

cylinders

The scene file is attached here: scene.zip.

Let me know if this works for your purposes!

Thanks,
Benedikt