Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert OpenGL code to WebGL

Tags:

webgl

I have done a graphics project using OpenGL and now I want to convert It into WebGL so that I can put it on the web. Is there any way to directly convert the OpenGL c++ codes to WebGL or I have to re-write manually ?? I have learnt only some basics of WebGL as I am also learning javascript in parallel(only because it is required in coding webgl). And any other suggestions are also welcomed.

like image 637
Bond Avatar asked Mar 27 '12 07:03

Bond


1 Answers

I'm surprised nobody mentioned Emscripten. It's not a perfect solution, and depending on how your code is structured and what libraries you use you may have to do some manual tweaking, but it works pretty well as a generic C++ to Javascript cross compiler.

I make no promises that it's a magic bullet, but it may be worth a look.

like image 51
Toji Avatar answered Sep 30 '22 08:09

Toji