Forums > Jitter

Fwd: bug with jit.gl.sketch and glloadidentity

May 5, 2008 | 6:51 pm

I don’t think this has been reported. If you pass the commands:’reset,
glmatrixmode modelview, glpushmatrix, drawmatrix myMatrix points,
glpopmatrix’
to jit.gl.sketch the scene is rendered. However, if glloadidentity is added
to the command list the scene is not rendered, or at least is not visible:
‘reset, glmatrixmode modelview, glpushmatrix, glloadidentity, drawmatrix
myMatrix points, glpopmatrix’

powerbook Mac G4, OS X 10.4.11 Max 5.01

pelado


May 5, 2008 | 7:02 pm

I think in this case you’re going to need to post a patch. I’m not
too surprised that you don’t see anything with glloadidentity as I
don’t see you modifying the modelview matrix after calling it.

wes

On Mon, May 5, 2008 at 11:51 AM, pelado

wrote:
> I don’t think this has been reported. If you pass the commands:
> ‘reset, glmatrixmode modelview, glpushmatrix, drawmatrix myMatrix points,
> glpopmatrix’
> to jit.gl.sketch the scene is rendered. However, if glloadidentity is added
> to the command list the scene is not rendered, or at least is not visible:
> ‘reset, glmatrixmode modelview, glpushmatrix, glloadidentity, drawmatrix
> myMatrix points, glpopmatrix’
>
> powerbook Mac G4, OS X 10.4.11 Max 5.01
>
> pelado
>
>
>
>
>


May 5, 2008 | 7:40 pm

On Mon, May 5, 2008 at 9:02 PM, Wesley Smith wrote:

> I think in this case you’re going to need to post a patch. I’m not
> too surprised that you don’t see anything with glloadidentity as I
> don’t see you modifying the modelview matrix after calling it.
>
> wes
>

Patch to illustrate below:

pelado

– Pasted Max Patch, click to expand. –

May 5, 2008 | 10:36 pm

Hi Pelado,
Here’s what you need to do:

reset, glclearcolor 1 0 0 1, glclear, glmatrixmode modelview,
glpushmatrix, glloadidentity, gltranslate -0.4 0 -2, glrotate $1 0 1
0, cube 0.2, glpopmatrix, gldisable depthtest, glenable blend,
glblendfunc 6 1, glcolor 1 1 0 0.5, glpushmatrix, glloadidentity,
gltranslate 0.8 0 -2, glrotate 90 0 1 0, cube 0.2,, glpopmatrix

In your patch you were rendering the cubes exactly at z=0 i.e. at the
location with the camera. This is what happens when you cal
glLoadIdentity() without offsetting in the Z direction.

wes


May 6, 2008 | 12:05 am

Ooops! Of course. And I was neglecting that the camera position is also
part of the modelview matrix. Sorry Wes. I guess I need to get back to the
red book.
pelado

On Tue, May 6, 2008 at 12:36 AM, Wesley Smith wrote:

> Hi Pelado,
> Here’s what you need to do:
>
> reset, glclearcolor 1 0 0 1, glclear, glmatrixmode modelview,
> glpushmatrix, glloadidentity, gltranslate -0.4 0 -2, glrotate $1 0 1
> 0, cube 0.2, glpopmatrix, gldisable depthtest, glenable blend,
> glblendfunc 6 1, glcolor 1 1 0 0.5, glpushmatrix, glloadidentity,
> gltranslate 0.8 0 -2, glrotate 90 0 1 0, cube 0.2,, glpopmatrix
>
> In your patch you were rendering the cubes exactly at z=0 i.e. at the
> location with the camera. This is what happens when you cal
> glLoadIdentity() without offsetting in the Z direction.
>
> wes
>

http://www.pelado.co.uk


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