You are not logged in.

#1 2011-09-15 15:15:30

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Implement simple ray tracer without OpenGL in C++?

Can I implement simple ray tracer without having access to OpenGL libraries (by just writing everything in C/C++)?

I just want to calculate simple ray tracing on one or two objects in the box.

Offline

#2 2011-09-15 15:23:06

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443

Re: Implement simple ray tracer without OpenGL in C++?

Why couldn't you? You can use any toolkit with pixelputting capabilites or you can just write the image data to a file as raw image, I think GIMP will open it.

Offline

#3 2011-09-16 15:55:46

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Implement simple ray tracer without OpenGL in C++?

Sure you can!  POV-Ray is one, for example.  I'm also writing one called Dimension, but in C/Python.  Technically it supports drawing to the screen with OpenGL 'cause I'm too lazy to use the X API directly, but you can build it with --disable-gl.

Last edited by tavianator (2011-09-16 16:00:46)

Offline

#4 2011-09-16 17:58:05

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Implement simple ray tracer without OpenGL in C++?

How do you use Python in yours?

Last edited by kdar (2011-09-16 17:58:14)

Offline

#5 2011-09-16 19:15:54

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Implement simple ray tracer without OpenGL in C++?

It's a C API with a Python binding, written in Cython.  The scene files are written as Python scripts, for example, this one.

Offline

#6 2011-09-19 08:00:06

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Implement simple ray tracer without OpenGL in C++?

check this!
http://www.flipcode.com/archives/Raytra … tion.shtml
and another articles in this tutorial

Offline

Board footer

Powered by FluxBB