[jitter] Smoothing with sketch and gl_commands
David Buff
david.buff at free.fr
Sun Mar 23 07:58:50 MDT 2008
- Previous message: [jitter] Re: Re: Re: Re: Render erase color
- Next message: [jitter] Re: Smoothing with sketch and gl_commands
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello, We have builded a patch witch load 3D objects (.obj) with a gl.model. Then we export the 3D matrix in jit.matrix using matrixoutput message and attempt to draw it with a gl.sketch using gl_command drawmatrix. The 3D object appears, but it is not smoothed. So we have search a gl_command to smooth it... Does anybody know the way to smooth our 3D object with a sketch drawing a jit.matrix? Thanks for help David Using max 4.6.3, jitter 1.6.3 and 3DStudioMax 6 with plugin MaxToObj to build the 3D objects Here is the patch, fellowed by the content of the Sphere.obj object. max v2; #N vpatcher 120 69 1177 755; #P window setfont "Sans Serif" 14.; #P window linecount 2; #P comment 443 560 360 196622 Selecting menu to normalX (or y or z) we can verrify that normal vectors are good...; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 140 581 27 196617 + 1; #P user jit.pwindow 125 605 295 29 0 1 0 0 1 1; #X name u628000085; #P newex 288 581 118 196617 switch 8 1; #P newex 301 559 118 196617 jit.unpack 8; #P user ubumenu 140 559 100 196617 0 1 1 0; #X add positionX; #X add positionY; #X add positionZ; #X add textureU; #X add textureV; #X add normalX; #X add normalY; #X add normalZ; #X prefix_set 0 0 <none> 0; #P window setfont "Sans Serif" 14.; #P comment 338 75 192 196622 This work perfectly...; #P window linecount 3; #P comment 642 324 258 196622 This also doesn't work... but we can see that light is enabled... How can we smooth this??; #P window setfont "Sans Serif" 9.; #P flonum 710 387 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P flonum 676 387 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P flonum 642 387 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 642 406 61 196617 pak 0. 0. 0.; #P window linecount 2; #P message 642 427 297 196617 reset \, glshademodel smooth \, glenable lighting \, glenable light0 \, gllight light0 position \$1 \$2 \$3 \, drawmatrix myModel triangles; #P window linecount 1; #P message 438 418 173 196617 lighting_enable 1 \, smooth_shading 1; #P message 437 442 181 196617 reset \, drawmatrix myModel triangles; #P message 353 418 34 196617 reset; #P newex 353 470 246 196617 jit.gl.sketch viewB @automatic 0 @position 0. 0. -1.; #P newex 354 346 98 196617 jit.matrix myModel; #P message 354 284 80 196617 read sphere.obj; #P newex 354 309 244 196617 jit.gl.model viewB 1 @automatic 0 @matrixoutput 1; #P message 337 103 80 196617 read sphere.obj; #P newex 191 312 96 196617 jit.gl.render viewB; #P newex 191 283 58 196617 t b b erase; #P newex 191 262 57 196617 qmetro 40; #P toggle 191 233 15 0; #P newex 16 216 48 196617 loadbang; #P message 16 237 132 196617 name viewB \, depthbuffer 1; #P newex 191 129 97 196617 jit.gl.render viewA; #P newex 191 100 58 196617 t b b erase; #P newex 191 79 57 196617 qmetro 40; #P toggle 191 50 15 0; #P newex 16 33 48 196617 loadbang; #P message 16 54 133 196617 name viewA \, depthbuffer 1; #P user jit.pwindow 15 72 150 114 0 1 0 0 1 1; #X name viewA; #P window linecount 2; #P newex 337 129 262 196617 jit.gl.model viewA @smooth_shading 1 @lighting_enable 1 @depth_enable 1 @automatic 0 @position 0. 0. -1.; #P user jit.pwindow 15 255 150 114 0 1 0 0 1 1; #X name viewB; #P window setfont "Sans Serif" 14.; #P window linecount 1; #P comment 439 393 184 196622 This doesn't work...; #P connect 5 0 4 0; #P connect 4 0 3 0; #P connect 11 0 10 0; #P connect 10 0 1 0; #P fasten 33 0 34 0 293 603 131 603; #P connect 31 0 35 0; #P connect 6 0 7 0; #P connect 7 0 8 0; #P connect 8 2 9 0; #P connect 8 0 9 0; #P connect 12 0 13 0; #P connect 13 0 14 0; #P connect 14 0 15 0; #P connect 14 2 15 0; #P fasten 35 0 33 0 145 598 251 598 251 572 293 572; #P fasten 17 0 32 0 359 335 306 335; #P connect 32 0 33 1; #P connect 32 1 33 2; #P connect 32 2 33 3; #P connect 16 0 2 0; #P fasten 8 1 2 0 220 123 342 123; #P connect 32 3 33 4; #P connect 14 1 20 0; #P fasten 24 0 20 0 647 465 358 465; #P fasten 23 0 20 0 443 436 358 436; #P connect 21 0 20 0; #P fasten 22 0 20 0 442 460 358 460; #P connect 32 4 33 5; #P fasten 14 1 17 0 220 304 359 304; #P connect 18 0 17 0; #P connect 17 0 19 0; #P connect 32 5 33 6; #P connect 32 6 33 7; #P connect 32 7 33 8; #P connect 26 0 25 0; #P connect 25 0 24 0; #P connect 27 0 25 1; #P connect 28 0 25 2; #P pop; ------------------------ Sphere.obj # Max2Obj Version 6.0 Jul 29th, 2003 # # object Sphere01 to come ... # v 0.000000 -41.231056 -0.000002 v -0.000001 -33.356625 24.235006 v -14.244982 -33.356625 19.606531 v -23.048862 -33.356625 7.489026 v -23.048862 -33.356625 -7.489033 v -14.244978 -33.356625 -19.606537 v 0.000003 -33.356625 -24.235010 v 14.244984 -33.356625 -19.606533 v 23.048864 -33.356625 -7.489027 v 23.048861 -33.356625 7.489032 v 14.244976 -33.356625 19.606535 v -0.000002 -12.741097 39.213066 v -23.048864 -12.741096 31.724035 v -37.293842 -12.741096 12.117500 v -37.293842 -12.741095 -12.117508 v -23.048859 -12.741095 -31.724039 v 0.000005 -12.741094 -39.213066 v 23.048866 -12.741095 -31.724033 v 37.293842 -12.741095 -12.117498 v 37.293839 -12.741096 12.117510 v 23.048855 -12.741096 31.724041 v -0.000002 12.741097 39.213062 v -23.048862 12.741098 31.724031 v -37.293839 12.741098 12.117500 v -37.293839 12.741100 -12.117505 v -23.048857 12.741100 -31.724037 v 0.000005 12.741101 -39.213062 v 23.048864 12.741100 -31.724030 v 37.293842 12.741100 -12.117496 v 37.293835 12.741098 12.117511 v 23.048853 12.741098 31.724039 v -0.000001 33.356628 24.235006 v -14.244980 33.356628 19.606531 v -23.048859 33.356628 7.489028 v -23.048859 33.356628 -7.489029 v -14.244976 33.356628 -19.606529 v 0.000003 33.356628 -24.235003 v 14.244981 33.356628 -19.606527 v 23.048861 33.356628 -7.489023 v 23.048857 33.356628 7.489034 v 14.244974 33.356628 19.606535 v 0.000000 41.231056 0.000002 # 42 vertices vt 0.000000 1.000000 0.000000 vt 0.100000 1.000000 0.000000 vt 0.200000 1.000000 0.000000 vt 0.300000 1.000000 0.000000 vt 0.400000 1.000000 0.000000 vt 0.500000 1.000000 0.000000 vt 0.600000 1.000000 0.000000 vt 0.700000 1.000000 0.000000 vt 0.800000 1.000000 0.000000 vt 0.900000 1.000000 0.000000 vt 1.000000 1.000000 0.000000 vt 0.000000 0.800000 0.000000 vt 0.100000 0.800000 0.000000 vt 0.200000 0.800000 0.000000 vt 0.300000 0.800000 0.000000 vt 0.400000 0.800000 0.000000 vt 0.500000 0.800000 0.000000 vt 0.600000 0.800000 0.000000 vt 0.700000 0.800000 0.000000 vt 0.800000 0.800000 0.000000 vt 0.900000 0.800000 0.000000 vt 1.000000 0.800000 0.000000 vt 0.000000 0.600000 0.000000 vt 0.100000 0.600000 0.000000 vt 0.200000 0.600000 0.000000 vt 0.300000 0.600000 0.000000 vt 0.400000 0.600000 0.000000 vt 0.500000 0.600000 0.000000 vt 0.600000 0.600000 0.000000 vt 0.700000 0.600000 0.000000 vt 0.800000 0.600000 0.000000 vt 0.900000 0.600000 0.000000 vt 1.000000 0.600000 0.000000 vt 0.000000 0.400000 0.000000 vt 0.100000 0.400000 0.000000 vt 0.200000 0.400000 0.000000 vt 0.300000 0.400000 0.000000 vt 0.400000 0.400000 0.000000 vt 0.500000 0.400000 0.000000 vt 0.600000 0.400000 0.000000 vt 0.700000 0.400000 0.000000 vt 0.800000 0.400000 0.000000 vt 0.900000 0.400000 0.000000 vt 1.000000 0.400000 0.000000 vt 0.000000 0.200000 0.000000 vt 0.100000 0.200000 0.000000 vt 0.200000 0.200000 0.000000 vt 0.300000 0.200000 0.000000 vt 0.400000 0.200000 0.000000 vt 0.500000 0.200000 0.000000 vt 0.600000 0.200000 0.000000 vt 0.700000 0.200000 0.000000 vt 0.800000 0.200000 0.000000 vt 0.900000 0.200000 0.000000 vt 1.000000 0.200000 0.000000 vt 0.000000 0.000000 0.000000 vt 0.100000 0.000000 0.000000 vt 0.200000 0.000000 0.000000 vt 0.300000 0.000000 0.000000 vt 0.400000 0.000000 0.000000 vt 0.500000 0.000000 0.000000 vt 0.600000 0.000000 0.000000 vt 0.700000 0.000000 0.000000 vt 0.800000 0.000000 0.000000 vt 0.900000 0.000000 0.000000 vt 1.000000 0.000000 0.000000 # 66 texture vertices vn -0.000000 -1.000000 -0.000000 vn -0.000000 -0.780444 0.625226 vn -0.367499 -0.780444 0.505818 vn -0.594625 -0.780444 0.193205 vn -0.594625 -0.780444 -0.193205 vn -0.367498 -0.780444 -0.505818 vn 0.000000 -0.780444 -0.625226 vn 0.367499 -0.780444 -0.505818 vn 0.594625 -0.780444 -0.193205 vn 0.594625 -0.780444 0.193205 vn 0.367498 -0.780444 0.505818 vn -0.000000 -0.292481 0.956271 vn -0.562082 -0.292481 0.773640 vn -0.909468 -0.292481 0.295504 vn -0.909468 -0.292481 -0.295504 vn -0.562082 -0.292481 -0.773640 vn 0.000000 -0.292481 -0.956271 vn 0.562082 -0.292481 -0.773640 vn 0.909468 -0.292481 -0.295504 vn 0.909468 -0.292481 0.295504 vn 0.562082 -0.292481 0.773640 vn -0.000000 0.292481 0.956271 vn -0.562082 0.292481 0.773640 vn -0.909468 0.292481 0.295504 vn -0.909468 0.292481 -0.295504 vn -0.562082 0.292481 -0.773640 vn 0.000000 0.292481 -0.956271 vn 0.562082 0.292481 -0.773640 vn 0.909468 0.292481 -0.295504 vn 0.909468 0.292481 0.295504 vn 0.562082 0.292481 0.773640 vn -0.000000 0.780444 0.625226 vn -0.367499 0.780444 0.505818 vn -0.594625 0.780444 0.193205 vn -0.594625 0.780444 -0.193205 vn -0.367498 0.780444 -0.505818 vn 0.000000 0.780444 -0.625226 vn 0.367499 0.780444 -0.505818 vn 0.594625 0.780444 -0.193205 vn 0.594625 0.780444 0.193206 vn 0.367498 0.780444 0.505818 vn -0.000000 1.000000 0.000000 # 42 vertex normals g Sphere01 f 1/1/1 2/12/2 3/13/3 f 1/2/1 3/13/3 4/14/4 f 1/3/1 4/14/4 5/15/5 f 1/4/1 5/15/5 6/16/6 f 1/5/1 6/16/6 7/17/7 f 1/6/1 7/17/7 8/18/8 f 1/7/1 8/18/8 9/19/9 f 1/8/1 9/19/9 10/20/10 f 1/9/1 10/20/10 11/21/11 f 1/10/1 11/21/11 2/22/2 f 2/12/2 12/23/12 13/24/13 f 2/12/2 13/24/13 3/13/3 f 3/13/3 13/24/13 14/25/14 f 3/13/3 14/25/14 4/14/4 f 4/14/4 14/25/14 15/26/15 f 4/14/4 15/26/15 5/15/5 f 5/15/5 15/26/15 16/27/16 f 5/15/5 16/27/16 6/16/6 f 6/16/6 16/27/16 17/28/17 f 6/16/6 17/28/17 7/17/7 f 7/17/7 17/28/17 18/29/18 f 7/17/7 18/29/18 8/18/8 f 8/18/8 18/29/18 19/30/19 f 8/18/8 19/30/19 9/19/9 f 9/19/9 19/30/19 20/31/20 f 9/19/9 20/31/20 10/20/10 f 10/20/10 20/31/20 21/32/21 f 10/20/10 21/32/21 11/21/11 f 11/21/11 21/32/21 12/33/12 f 11/21/11 12/33/12 2/22/2 f 12/23/12 22/34/22 23/35/23 f 12/23/12 23/35/23 13/24/13 f 13/24/13 23/35/23 24/36/24 f 13/24/13 24/36/24 14/25/14 f 14/25/14 24/36/24 25/37/25 f 14/25/14 25/37/25 15/26/15 f 15/26/15 25/37/25 26/38/26 f 15/26/15 26/38/26 16/27/16 f 16/27/16 26/38/26 27/39/27 f 16/27/16 27/39/27 17/28/17 f 17/28/17 27/39/27 28/40/28 f 17/28/17 28/40/28 18/29/18 f 18/29/18 28/40/28 29/41/29 f 18/29/18 29/41/29 19/30/19 f 19/30/19 29/41/29 30/42/30 f 19/30/19 30/42/30 20/31/20 f 20/31/20 30/42/30 31/43/31 f 20/31/20 31/43/31 21/32/21 f 21/32/21 31/43/31 22/44/22 f 21/32/21 22/44/22 12/33/12 f 22/34/22 32/45/32 33/46/33 f 22/34/22 33/46/33 23/35/23 f 23/35/23 33/46/33 34/47/34 f 23/35/23 34/47/34 24/36/24 f 24/36/24 34/47/34 35/48/35 f 24/36/24 35/48/35 25/37/25 f 25/37/25 35/48/35 36/49/36 f 25/37/25 36/49/36 26/38/26 f 26/38/26 36/49/36 37/50/37 f 26/38/26 37/50/37 27/39/27 f 27/39/27 37/50/37 38/51/38 f 27/39/27 38/51/38 28/40/28 f 28/40/28 38/51/38 39/52/39 f 28/40/28 39/52/39 29/41/29 f 29/41/29 39/52/39 40/53/40 f 29/41/29 40/53/40 30/42/30 f 30/42/30 40/53/40 41/54/41 f 30/42/30 41/54/41 31/43/31 f 31/43/31 41/54/41 32/55/32 f 31/43/31 32/55/32 22/44/22 f 42/56/42 33/46/33 32/45/32 f 42/57/42 34/47/34 33/46/33 f 42/58/42 35/48/35 34/47/34 f 42/59/42 36/49/36 35/48/35 f 42/60/42 37/50/37 36/49/36 f 42/61/42 38/51/38 37/50/37 f 42/62/42 39/52/39 38/51/38 f 42/63/42 40/53/40 39/52/39 f 42/64/42 41/54/41 40/53/40 f 42/65/42 32/55/32 41/54/41 # 80 faces g
- Previous message: [jitter] Re: Re: Re: Re: Render erase color
- Next message: [jitter] Re: Smoothing with sketch and gl_commands
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
