Fwd: bug with jit.gl.sketch and glloadidentity

May 5, 2008 at 6:51pm

Fwd: bug with jit.gl.sketch and glloadidentity

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

#37563
May 5, 2008 at 7:02pm

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
>
>
>
>
>

#129882
May 5, 2008 at 7:40pm

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. –
#129883
May 5, 2008 at 10:36pm

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

#129884
May 6, 2008 at 12:05am

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

#129885

You must be logged in to reply to this topic.