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.
IndexProgramming Questions & HelpPrograms › Render Problem
Page Index Toggle Pages: 1
Render Problem (Read 814 times)
Render Problem
Feb 21st, 2007, 6:34pm
 
Hi everyone:  
I'm Decinoge, and i'm a portuguese student of what is suposed to be Digital Arts.

introduction made, i'm goin straight to the point. i'm trying to do some cool effects for a background, using likes and circles, simple stuff like lines scrooling down. to make it even more interesting, i've taken advantage of pushMatrix(), translate() and rotateX/Y/Z(), with great success. I was doing all this in a "surface" created with PGraphics, createGraphics() more specifly. everything was fine cause i had a prety surface, where i could draw whatever i wanted, and then POW, on the back. however createGraphics() only works with JAVA2D and P3D. JAVA2D is out of question because my prety elevated points (with Z values bigger than 0) couldn't be done. And P3D is slow as a  $1000 dollar wh**e (no harm meanted for the creator, it just aint the right tool for this work). well, i eleminated my surface, and made it directly into the "screen". its great because i'm runing it in open GL, and my frame rate went from 40 up to 50up (almost 60, even with a framerate set of 50). BUT... and here comes the problem, the "elevated points" now appear IN FRONT of the things that are drawn on the background. that is terrible because i dont apreciate having my stuff messed with a BACKGROUND.

the question is, is there any way of doing the background drawing in a surface, that would be rendered with openGL instead of P3D?

or

having a way a sending it all WAY back (kinda like translating the Z), without having that distorced prespective effect? (simply sending everything back (a bunch... LOTS) is a possibility, but i want it to be the last resort. it would emply alot of REcoding and recalibratin a major part of the Backgrounds i'm "created" so far).

i must ask your forgiveness for my terrible english. and i'll be thankfull for any piece of help.
Re: Render Problem
Reply #1 - Feb 21st, 2007, 7:09pm
 
You could try adding:

Code:
//at the top:
import javax.media.opengl.*;

//after drawing one set of things, before the ones you want to appear "in-front-of"
((PGraphicsOpenGL)g).gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
Re: Render Problem
Reply #2 - Mar 13th, 2007, 4:39pm
 
i hate to bring this topic up, but i still have problems with openGL. mostly because i dont know how to use it.

[edit]
i had a big post in here whinning about how i was unable to use the previous code, and how stupid i was. well... after a few weeks i finaly noticed that i had to have both processing.openGL library, and that java library. -_-''
i have a friend that calls this kind of stupid distractions "the industry".

so instead i post saying a big thanks to JohnG.

however, i have another problem. scaling.
so, the thing is, this draws the... "stuff" in a surface. its cool, good and fast openGL. even cooler would be if i was able to make that surface thingie in the end, once again, and then scale it to 200%, so i could get a 320x240 surface, on a 640x480 screen, meaning, BIG PIXELS (pixel obcession here).

i would know how to zoom it with circles. however, i dont know what in that code is the surface, or even if openGL has faster methods that would do that scaling for me. i dont even know if there is an even faster and better way to do it.

so in the end what do i want?
i want to draw my program on a 640x480 window. i want the action only to happen betwin a 320x240 rectangle of that window (this one i have), and now, i want to zoom that to 640x480, with the pixel increacing thingie (thats why scale doesn't work, because it scales the points and not the pixels).

and thats it. thank again for the previous code (sorry for the delay), and any help would be much apreciated.

bye and thanks = all.
Page Index Toggle Pages: 1