I have a python web server (cherrypy), and I want the user to be able to pute certain surfaces of this precise type. This is what I am able to generate from user input. He gives me some parameters, I pute my things, generate it as PNG on the server (matplotlib/numpy) and send it back through a JQuery load.
Problem is, this is pretty lame, and the surfaces can have various aspects. I'd like to be able to have an actual widget or so that would enable the user to rotate his surface...
My major constraints is that it has to work on IE 7 (8 would be cool as well), and allow the input of the data I pute somehow. I've seen many things on the web that only permit to input parametric functions. What I need is to be able to push in raw data triplets.
I've been looking at several things, Javascript would be the best but I failed to see something in JQuery or equivalents. I did look quite long around WebGL and started implementing stuff...from scratch... but way too long and random behavior in IE sometimes.
Maybe I'm missing out pletely on something, on some technology or format that is patible with my python, but I've spent days before adopting the temporary solution of plotting into PNGs.
Looking forward to reading you guys, Thanks in advance ;)
I have a python web server (cherrypy), and I want the user to be able to pute certain surfaces of this precise type. This is what I am able to generate from user input. He gives me some parameters, I pute my things, generate it as PNG on the server (matplotlib/numpy) and send it back through a JQuery load.
Problem is, this is pretty lame, and the surfaces can have various aspects. I'd like to be able to have an actual widget or so that would enable the user to rotate his surface...
My major constraints is that it has to work on IE 7 (8 would be cool as well), and allow the input of the data I pute somehow. I've seen many things on the web that only permit to input parametric functions. What I need is to be able to push in raw data triplets.
I've been looking at several things, Javascript would be the best but I failed to see something in JQuery or equivalents. I did look quite long around WebGL and started implementing stuff...from scratch... but way too long and random behavior in IE sometimes.
Maybe I'm missing out pletely on something, on some technology or format that is patible with my python, but I've spent days before adopting the temporary solution of plotting into PNGs.
Looking forward to reading you guys, Thanks in advance ;)
Share Improve this question edited Nov 4, 2011 at 17:00 BuZz asked Nov 4, 2011 at 16:13 BuZzBuZz 17.5k34 gold badges92 silver badges147 bronze badges 3- 1 Can chrome-frame be a requirement? – fnp Commented Nov 4, 2011 at 17:17
- Well I was thinking about that, one some forum one guy did a nice summary of the best ways to use WebGL, chrome frame was evaluated as a solution as good as IEWebGL. I cannot consider it tough, because I need an install-less approach.. Sorry ;) – BuZz Commented Nov 4, 2011 at 17:28
- 1 Worth a shot. It doesn't require admin rights anymore, if that helps – fnp Commented Nov 7, 2011 at 2:00
4 Answers
Reset to default 3As far as I know, if you need IE7 patibility, most of the available libraries in JS won't work for you - they require either canvas
or SVG support. You're left with static images, Flash, or Java applets.
I would look into processing, which has good 3D support and can create Java applets for web use. See the 3D tutorials for good examples of interactive 3D surfaces.
If you wanted to get fancy, you could potentially also offer processing.js for browsers that support the canvas
element. This would avoid loading a Java applet for those browsers, making for a slightly smoother UI and removing the Java dependency. You'd need to check for browser patibility and then load either the applet code or the processing.js code. The upside of this is that you should be able to use exactly the same processing code in both cases.
have the python script return the vertices/points of the 3D model in json format then use mrdoob's three.js to create a live, javascript-powered, 3D, webGL model directly in the browser.
Check out three.js here: https://github./mrdoob/three.js
(Look at the amazing examples there for inspiration, you can probably get a hold of mrdoob for insights also...)
EDIT: Oops, just noticed the IE7 requirement. No webGL for IE7 :(. You'll have to use Flash for 3D rendering. EIther that or have your python script create different angles of the view that can be loaded as images in the browser (for example the user clicks on the right button and the next image that loads is rotated at a certain angle to the right).
EDIT: Looks like IEWebGL will enable webGL for IE7!
EIDT: processing.js looks really nice for visualizations too!
I was looking for something similar (contour plots in JS) and came across one that looks like it works in IE6 (using excanvas): http://code.google./p/javascript-surface-plot/
It uses the Google Visualization API:
var data = new google.visualization.DataTable();
for (var i = 0; i < numCols; i++) {
data.addColumn('number', 'col' + i);
}
data.addRows(numRows);
var d = 360 / numRows;
var idx = 0;
for (var i = 0; i < numRows; i++) {
for (var j = 0; j < numCols; j++) {
var value = (Math.cos(i * d * Math.PI / 180.0) * Math.cos(j * d * Math.PI / 180.0));
data.setValue(i, j, value / 4.0);
tooltipStrings[idx] = "x:" + i + ", y:" + j + " = " + value;
idx++;
}
}
so maybe you can load that up with your triplet data.
You want to use Pre3d. It doesn't use WebGL. It uses canvas element. here is the example of it http://www.graphycalc./
Use explorecanvas to add canvas support to IE.