glperspective gluperspective aspect ratio?

Aug 28, 2007 at 2:29pm

glperspective gluperspective aspect ratio?

hi all,

I’m trying to change the aspect ratio of my jit.gl.render.
I tried jit.gl.sketch with glperspective but nothing changes. Is that a mistake in the documentation? should it be gluperspective?
With gluperspective something happens but I don’t understand the result. I expected it to be gluperspective fovy aspect zNear zFar.
I used values like gluperspective 45. 1. 0.1 10. but the results look somehow drastic. Like wrapped around. I can’t figure out the right values. What’s wrong with that. Is there any other possibility to set the aspect ratio?

thanks

secco

#33442
Aug 28, 2007 at 5:37pm

Try this patch. The problem is most likely you’re not changing the
matrixmode to projection and/or you’re not loading the identity matrix
before calling gluperspective. If you read the spec on gluperspective
carefully, you’ll see that it creates a matrix and then does the
equivalent of glmultmatrix on what is already loaded. This is a
common mistake.

#P window setfont “Sans Serif” 9.;
#P flonum 89 175 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P message 89 196 254 196617 reset , glmatrixmode projection ,
glloadidentity , gluperspective 45 $1 0.1 100 , drawobject throbber
0;
#P window linecount 1;
#P newex 89 226 85 196617 jit.gl.sketch test;
#P window linecount 2;
#P newex 91 273 234 196617 jit.gl.gridshape test @shape torus @color 1
0 0 1 @lighting_enable 1 @name throbber @automatic 0;
#P window linecount 1;
#P message 149 77 34 196617 reset;
#P newex 149 97 186 196617 jit.gl.handle test @inherit_transform 1;
#P newex 14 97 48 196617 r render;
#P toggle 129 68 15 0;
#N vpatcher 53 128 279 297;
#P inlet 106 30 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 43 95 47 196617 gate 1 1;
#P newex 42 116 41 196617 s draw;
#P window linecount 1;
#P newex 17 52 58 196617 t b b erase;
#P inlet 17 32 15 0;
#P outlet 17 83 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 2 2 0 0 70 75 22 75;
#P connect 4 0 3 0;
#P fasten 5 0 4 0 111 88 48 88;
#P fasten 2 1 4 1 46 83 85 83;
#P lcolor 15;
#P pop;
#P newobj 67 97 42 196617 p Draw;
#P toggle 205 36 15 0;
#P message 205 56 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont “Sans Serif” 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 222 36 33 196617 p Esc;
#P newex 205 74 151 196617 jit.window test @depthbuffer 1;
#P toggle 67 49 15 0;
#P newex 67 68 57 196617 qmetro 30;
#P newex 67 124 187 196617 jit.gl.render test @erase_color 0 0 0 1;
#P connect 14 0 13 0;
#P connect 15 0 14 0;
#P connect 5 0 3 0;
#P connect 6 0 5 0;
#P connect 4 0 6 0;
#P connect 11 0 10 0;
#P fasten 8 0 7 1 134 90 104 90;
#P fasten 9 0 0 0 19 119 72 119;
#P connect 7 0 0 0;
#P fasten 10 0 0 0 154 119 72 119;
#P connect 1 0 7 0;
#P connect 2 0 1 0;
#P window clipboard copycount 16;

#111439
Aug 28, 2007 at 6:46pm

Thanks a lot wes. What do you mean with spec? The redbook?

secco

#111440
Aug 29, 2007 at 8:26am

I mean the manpage for the function which can be found in the redbook
or on the opengl site. You can also do a google search
“gluperspective site:apple.com”

wes

On 8/28/07, secco wrote:
>
> Thanks a lot wes. What do you mean with spec? The redbook?
>
> secco
>

#111441
Sep 17, 2007 at 4:32am

#111442

You must be logged in to reply to this topic.