We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Pages: 1 2 
OPenGL applets, woo. (Read 6047 times)
OPenGL applets, woo.
Mar 24th, 2006, 12:41pm
 
Just something I knocked together in a few hours last night, as encouragement for the development of OpenGL in applets.

I just wanted to see how man ypolygons I coudl get on ascreen at once all moving together etc, and the answer appears to be "quite a few"

http://www.hardcorepawn.com/RandomGL/
Re: OPenGL applets, woo.
Reply #1 - Mar 24th, 2006, 8:12pm
 
sweet, is that automatic when you use OPENGL in the latest releases or do you have to do something?
Re: OPenGL applets, woo.
Reply #2 - Mar 24th, 2006, 8:16pm
 
There is a little work needed, but no where near as much as previously. I think you'll have to wait for 0111 to come out first though as I had to use my slightly altered version.

Basicly you export as normal, edit the HTML file a little, then upload it with certain jar files. No need to set up a keystore and sign things anymore.
Re: OPenGL applets, woo.
Reply #3 - Mar 24th, 2006, 8:34pm
 
cool i'll have to check it out.. I use Eclipse most of the time anyways. But this is exciting news indeed that it is at all possible, as I'm pretty close to finishing my mesh/skeletal animation importer library.
Can you describe what exactly you did to get it to run in opengl?
Re: OPenGL applets, woo.
Reply #4 - Mar 24th, 2006, 9:03pm
 
Well, I've never used any external Java thing to build stuff so you may hav to translate this for your situation.

Basicly, I did the sketch as normal (with OpenGL) then exported to an applet.

Edit the HTML file so it resembles:
Code:
<applet code="com.sun.opengl.util.JOGLAppletLauncher" 
archive="jogl.jar,MySketch.jar"
width="800" height="600" mayscript="true">
<param name="image" value="loading.gif">
<param name="boxmessage" value="Loading Processing software...">
<param name="boxbgcolor" value="#FFFFFF">
<PARAM NAME="progressbar" value="true">
<param name="subapplet.classname" VALUE="MySketch">
<param name="subapplet.displayname" VALUE="Random OpenGL thing">
</applet>


Then get the jsr-231 beta 03 jogl.jar and jogl-natives-*.jar files from https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=4843&expandFolde
r=4843&folderID=0
And put them in the same directory as the HTML/MySketch.jar file on your server, and it'll just work.

This is all dependant on a slight change to processing-0110 though, but which will be fixed with 0111 I believe.
0111 may also come with the beta 03 versions of the jogl jar files so you don't need to go get them yourself.

If you can't wait for 0111 the change to make to the processing source is very simple, and is documented at http://dev.processing.org/bugs/show_bug.cgi?id=309
Re: OPenGL applets, woo.
Reply #5 - Apr 7th, 2006, 12:30am
 
Hot badger biscuits, looks amazing. I'm getting a funny pause in Firefox every now and then though, is that normal? After seeing your applet it made me consider putting up an opengl online version of my latest project but considering its a game, that pause could be a pain in the butt. Is it just me?
Re: OPenGL applets, woo.
Reply #6 - Apr 10th, 2006, 3:38pm
 
hello all,

Was the export applet that uses OPENGL implemented in 111 in the end?

When I attempt to export a sketch that uses OPENGL either as an applet or as an application neither will run at all. My sketch runs fine (if very slow) as an applet in a browser using the normal processing renderer but I just get a blank white stage when I try to run it in abrowser when exported using OPENGL?

cheers,

james

Re: OPenGL applets, woo.
Reply #7 - Apr 10th, 2006, 5:32pm
 
You need to do a little bit of work to get it to work, but nowhere near as much as pre-0111.

I did a write up here: http://www.processinghacks.com/hacks/opengl_applet
Re: OPenGL applets, woo.
Reply #8 - Apr 11th, 2006, 10:50am
 
that's a huge help JohnG! many thanks!

j
Re: OPenGL applets, woo.
Reply #9 - Apr 11th, 2006, 5:08pm
 
Nope, its just me. Runs fine on Macs at school.
Re: OPenGL applets, woo.
Reply #10 - Apr 20th, 2006, 10:40am
 
Fantastic!

I'm having trouble though getting my applet to work on-line (following your tutorial at http://www.processinghacks.com/hacks/opengl_applet ; thanks by the way for making it).  It seems those 4 files need to be placed within /com/sun/opengl/util and not within the root directory of the applet (easily changed by modifying the html that accompanies the applet I guess).  And I had to download files from https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=4843& ;exp (the link you provided above), to get hold of a .class file that the java console was saying did not exist (i'm using Processing version 0113).  

Fingers crossed I'm doing something wrong!  I still can't get my opengl applet to work (p3d works fine) so hopefully my steps above are stopping things working.  Any ideas?  

Cheers, Andy.
Re: OPenGL applets, woo.
Reply #11 - Apr 20th, 2006, 10:51am
 
With 113 you don't need to do anything at all, processing does all the work for you, or at least should be doing. See the note at the top of the hack page.

You shouldn't be having to create any subdirectories at all, or using different files.
Re: OPenGL applets, woo.
Reply #12 - Apr 21st, 2006, 6:19pm
 
Thanks! Didn't see that bit of text at the top of the hack.

My opengl applet didn't work at first, and after much scrolling of code, scratching of head and loud swearing I found that for some reason my applet only works when I specify the screen size using numbers, and not using variables specified elsewhere.  Eg.

 size(800,600, OPENGL); works
 size(xdimension,ydimension, OPENGL); does not work

I think I encountered this problem once before.  It may have been when I was using P3D.

Anyway, not really such a big problem!  Thanks you guys for all your great work you've done for Processing.  
Re: OPenGL applets, woo.
Reply #13 - Apr 21st, 2006, 6:29pm
 
if your applet is coming out as 100x100, then that's because it can't figure out the size for the applet because you've used variables.

this is why the first or second line of the size() reference says "don't use variables" for the size. Wink
Re: OPenGL applets, woo.
Reply #14 - Apr 21st, 2006, 7:06pm
 
st33d wrote on Apr 11th, 2006, 5:08pm:
Nope, its just me. Runs fine on Macs at school.


sometimes i get hickups with GL applets too. i figured it's due to either skype / IM or my apache running on the same machine. a restart and quitting everything unneeded seems to fix the problem ... anyone an idea how to track what exactly is causing the problem

(os-x 10.4 | safari / firefox)

best,
F
Pages: 1 2