Forums > Jitter

Creating escher in openGL

January 30, 2008 | 7:32 pm

Hi,

I’d like very much to create Escher-like effects by having certain shapes which should normally be obscured by objects which are nearer to the camera, rendered to the screen anyway.

Concrete example:

I’ve got 2 equally sized cubes standing behind each other. The camera is placed in such a way that it sees only the one in the front.
Now I want the possibility of drawing the cube in the back to the screen also, as if it were just a little cube standing in front of a bigger cube.
The fun of this effect would be that by just rotating the camera we’d get an impression of a little and a big cube at one point, and the impression of two equally sized cubes at another.

I sure hope this kind of stuff can be done in Max, and that someone knows how to do it!

Thanks – Tarik


January 31, 2008 | 10:03 am

You can get 360′ panoramic using the lens_angle attribute of
jit.gl.render. I believe there is also an ortho attribute which
removes perspective distortion completely. But I’m not sure if this
is what you’re after.

You might be able to delve deeper and muck around directly with the
OpenGL projection matrix though jit.gl.sketch or using jit.gl.lua
etc. It would be interesting to know what is possible…

On Jan 30, 2008, at 11:32 AM, Tarik wrote:

>
> Hi,
>
> I’d like very much to create Escher-like effects by having certain
> shapes which should normally be obscured by objects which are
> nearer to the camera, rendered to the screen anyway.
>
> Concrete example:
>
> I’ve got 2 equally sized cubes standing behind each other. The
> camera is placed in such a way that it sees only the one in the front.
> Now I want the possibility of drawing the cube in the back to the
> screen also, as if it were just a little cube standing in front of
> a bigger cube.
> The fun of this effect would be that by just rotating the camera
> we’d get an impression of a little and a big cube at one point, and
> the impression of two equally sized cubes at another.
>
> I sure hope this kind of stuff can be done in Max, and that someone
> knows how to do it!
>
> Thanks – Tarik

Be seeing you

grrr waaa
http://www.grahamwakefield.net


January 31, 2008 | 10:53 am

Thanks for the answer,

But I do think that indeed I’ll have to delve deeper.

I have an idea of what to do, but don’t know how to do it. I’ll try and explain it in these 2 steps:

1. draw a certain 3d image, all normal-like
2. draw a second 3d image on top of the first one, of which none of the pixels will be obscured.

I have discovered that a very basic version of this can be done by turning off the depth_enable attribute of the gl objects that I want to be drawn. But I don’t want to completely disregard all of the depth information: I just want the depth information generated in step 1. to be disregarded by the rendering process used in step 2.

Well, if not getting closer to the anwer, I’m at least getting closer to the real question that I want to ask!

– Tarik


January 31, 2008 | 8:29 pm

Quote: Tarik wrote on Thu, 31 January 2008 03:53
—————————————————-
But I don’t want to completely disregard all of the depth information: I just want the depth information generated in step 1. to be disregarded by the rendering process used in step 2.
—————————————————-

i don’t understand the difference.


January 31, 2008 | 8:53 pm

On Jan 31, 2008, at 12:29 PM, Robert Ramirez wrote:

>
> Quote: Tarik wrote on Thu, 31 January 2008 03:53
> —————————————————-
> But I don’t want to completely disregard all of the depth
> information: I just want the depth information generated in step 1.
> to be disregarded by the rendering process used in step 2.
> —————————————————-
>
> i don’t understand the difference.

I believe that Tarik wishes the following:

1. render some geometry which respects depth buffering for itself
(i.e. back faces won’t render over front faces when rendering
something like a sphere or whatever)

2. render some other geometry which also respects depth buffering for
itself yet not the previously rendered geometry.

This is accomplished by enabling depth buffering, but clearing the
depth buffer between rendering each geometry. You can either send the
message depth_clear to jit.gl.render, or set an individual jit.gl.*
object’s @depth_clear attribute (which will clear the depth buffer
before rendering, most useful in conjunction with the @layer
attribute), or you can use the "glclear depth" or "gldepthclear
" messages to jit.gl.sketch, or jit.gl.lua OpenGL solutions,
or…

Hope that helps.

-Joshua


February 1, 2008 | 3:30 pm

Thanks Joshua!

Not only have I gotten a dozen of perfect solutions for my problem, also now I can finally concentrate on doing very nifty openGL stuff thanks to my introduction to jit.gl.lua! This makes me very happy.

Cheers – T


Viewing 6 posts - 1 through 6 (of 6 total)