Forums > Jitter

Texture displays differently when using matrixoutput on jit.gl.model

April 1, 2008 | 3:22 pm

Hi Board,

A problem i stumbled across while using jit.gl.model is that the texture looks different when turning matrixoutput on. Looks somewhat like the texture is only rotated or wrapped, but I’m not sure how exactly. Is there a way to either fix this, or make a workaround (do a 2d operation on the texture or texture planes? As I’ll be using logos and text it’s essential that the texture is displayed correctly.

I’ve been wanting to add some jit.gl.models to my 3d scenes. The app I’ve built is a modular effects stacker. I do understand that the matrixoutput of jit.gl.gridshape, jit.gl.nurbs, jit.gl.videoplane is very different from the matrixoutput of jit.gl.model. That’s why i don’t use the same effects for both of them. But it would be nice to have some effects for the models as well, so that’s why i want to use the matrixoutput attribute.

Thanks, Bas.

#P button 15 117 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 15 144 48 196617 loadbang;
#P toggle 124 40 15 0;
#P window setfont "Sans Serif" 14.;
#P message 124 63 121 196622 matrixoutput $1;
#P window setfont "Sans Serif" 9.;
#P message 124 219 73 196617 read apple.obj;
#P message 255 182 50 196617 reset;
#P window linecount 2;
#P newex 255 202 104 196617 jit.gl.handle mdl @auto_rotate 1;
#P window linecount 1;
#P newex 15 225 57 196617 qmetro 20;
#P newex 15 272 50 196617 t b erase;
#P window linecount 2;
#P newex 124 248 240 196617 jit.gl.model mdl @depth_enable 1 @smooth_shading 1 @material_mode 2 @lighting_enable 1;
#B color 5;
#P window linecount 1;
#P newex 15 314 80 196617 jit.gl.render mdl;
#P newex 15 335 311 196617 jit.window mdl @depthbuffer 1 @rect 614 76 934 316 @floating 0;
#P comment 141 40 125 196617 change and watch texture;
#P connect 11 0 5 0;
#P connect 11 0 8 0;
#P connect 12 0 11 0;
#P connect 7 0 6 0;
#P connect 9 0 3 0;
#P connect 8 0 3 0;
#P fasten 6 0 3 0 260 243 129 243;
#P connect 10 0 9 0;
#P connect 4 1 2 0;
#P connect 4 0 2 0;
#P connect 3 0 2 0;
#P connect 5 0 4 0;
#P window clipboard copycount 13;


April 4, 2008 | 12:43 pm

Quote: Bas van der Graaff wrote on Tue, 01 April 2008 17:22
—————————————————-
> Hi Board,
>
> A problem i stumbled across while using jit.gl.model is that the texture looks different when turning matrixoutput on.

I can reproduce. I guess this classifies as a bug?

Mattijs


April 4, 2008 | 12:55 pm

I can reproduce as well…
But besides fixing this bug, it would be cool if we could access jit.gl.models internal jit.gl.texture objects, like sendinput for jit.gl.slab…


April 4, 2008 | 1:07 pm

Okay, I got a little bit further. Using a separate texture will al least allow the texture to look the same regardless of the matrixoutput attribute. Downside of this approach is that I now need to get the texture file from the .obj file. Also, only one group is drawn, namely the last one to enter jit.gl.mesh. Using a poly~ should solve this, but i think it’s a lot of work just to get something like this working.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 160 297 105 196617 jit.unpack 1 @jump 5;
#P message 82 144 53 196617 enable $1;
#P message 426 225 42 196617 skin.tif;
#P newex 426 248 68 196617 prepend read;
#P newex 426 270 154 196617 jit.gl.texture mdl @name mytex;
#P button 15 117 15 0;
#P newex 15 144 48 196617 loadbang;
#P toggle 122 40 15 0;
#P message 138 144 121 196617 matrixoutput $1;
#P message 162 225 73 196617 read apple.obj;
#P message 99 372 50 196617 reset;
#P newex 99 392 155 196617 jit.gl.handle mdl @auto_rotate 1;
#P newex 15 225 57 196617 qmetro 20;
#P newex 15 272 50 196617 t b erase;
#P newex 15 392 80 196617 jit.gl.render mdl;
#P newex 15 418 311 196617 jit.window mdl @depthbuffer 1 @rect 614 76 934 316 @floating 0;
#P window linecount 2;
#P newex 160 336 267 196617 jit.gl.mesh mdl @draw_mode triangles @texture mytex @smooth_shading 1 @lighting_enable 0 @color 1. 1. 1. 1.;
#P newex 160 248 263 196617 jit.gl.model mdl @depth_enable 1 @smooth_shading 1 @material_mode 2 @lighting_enable 0 @color 1. 1. 1. 1.;
#B color 5;
#P connect 6 0 0 0;
#P connect 6 0 1 0;
#P connect 7 0 6 0;
#P connect 10 0 16 0;
#P connect 10 0 9 0;
#P connect 11 0 5 0;
#P connect 11 0 8 0;
#P connect 11 0 15 0;
#P connect 14 0 13 0;
#P connect 15 0 14 0;
#P connect 17 0 1 0;
#P connect 16 0 1 0;
#P connect 0 0 17 0;
#P connect 9 0 0 0;
#P connect 8 0 0 0;
#P connect 4 0 3 0;
#P connect 4 1 3 0;
#P connect 5 0 4 0;
#P connect 12 0 11 0;
#P window clipboard copycount 18;


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