Size troubles with model crossfades

Sep 6, 2006 at 7:49pm

Size troubles with model crossfades

Hi,

I’m doing crossfades between different models, loaded from Obj-files which were exported from 3ds Max. Now it seems that when I fade from a large object (an elephant for instance) to a small object (a fly), the size doesn’t really change. Only the shape changes. It’s as if the matrix data is being “normalized” in some way that I don’t want it to.

It probably has something to do with the problem you will see in this next example (pasted below): here I try to use xfade to morph two gridshapes. The sizes of the two gridshapes can be adjusted with the number boxes in the upper right of the patch. But only the left number box (for the first gridshape object) seems to have any effect. The size of the second gridshape object entering the xfade object doesn’t seem to be taken into account, even if you put the xfade amount to 1.

Just try it and you’ll know what I’m talking about… help would be very much appreciated!

########################################################

#P window setfont “Sans Serif” 9.;
#P flonum 320 34 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 320 60 43 9109513 scale $1;
#P flonum 367 34 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 367 60 43 9109513 scale $1;
#P comment 8 22 85 9109513 • start rendering;
#P comment 153 112 75 9109513 • xfade amount;
#P window linecount 2;
#P comment 250 230 150 9109513 jit.xfade is actually crossfading between two geometry matrices;
#P comment 129 46 114 9109513 • pick two shapes and crossfade between them;
#P hidden message 101 194 94 9109513 smooth_shading 1 , lighting_enable 1;
#P user jit.fpsgui 51 260 60 9109513 0;
#P window linecount 3;
#P newex 367 100 115 9109513 jit.gl.gridshape foo @shape sphere @matrixoutput 1;
#P window linecount 1;
#P hidden newex 66 122 50 9109513 loadbang;
#P window linecount 3;
#P hidden message 66 148 110 9109513 camera 3 3 3 , quad_grid , smooth_shading 1 , lighting_enable 1;
#P flonum 178 127 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 178 152 48 9109513 xfade $1;
#P newex 246 202 52 9109513 jit.xfade;
#P newex 7 85 43 9109513 jit.qball;
#P number 52 38 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 7 38 15 0;
#P newex 7 62 55 9109513 metro 20;
#P newex 7 151 55 9109513 t b erase b;
#P window linecount 3;
#P newex 246 100 86 9109513 jit.gl.gridshape foo @shape torus @matrixoutput 1;
#P window linecount 1;
#P newex 8 390 80 9109513 jit.gl.render foo;
#P newex 96 391 145 9109513 jit.window foo @depthbuffer 1;
#P connect 5 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 3 0;
#P fasten 3 1 1 0 34 345 13 345;
#P connect 3 0 1 0;
#P hidden fasten 11 0 1 0 71 379 13 379;
#P connect 8 0 1 0;
#P connect 3 2 14 0;
#P connect 6 0 4 1;
#P hidden connect 12 0 11 0;
#P hidden fasten 12 0 15 0 71 144 106 144;
#P connect 10 0 9 0;
#P fasten 22 0 2 0 325 95 251 95;
#P hidden connect 15 0 2 0;
#P connect 9 0 8 0;
#P connect 2 0 8 0;
#P fasten 13 0 8 1 372 191 293 191;
#P connect 23 0 22 0;
#P connect 21 0 20 0;
#P connect 20 0 13 0;
#P window clipboard copycount 24;

#27513
Sep 6, 2006 at 8:00pm

yup, use @normalize 0 in jit.gl.model.

v a d e //

http://www.vade.info
abstrakt.vade.info

On Sep 6, 2006, at 3:49 PM, Tarik wrote:

>
> Hi,
>
> I’m doing crossfades between different models, loaded from Obj-
> files which were exported from 3ds Max. Now it seems that when I
> fade from a large object (an elephant for instance) to a small
> object (a fly), the size doesn’t really change. Only the shape
> changes. It’s as if the matrix data is being “normalized” in some
> way that I don’t want it to.
>
> It probably has something to do with the problem you will see in
> this next example (pasted below): here I try to use xfade to morph
> two gridshapes. The sizes of the two gridshapes can be adjusted
> with the number boxes in the upper right of the patch. But only the
> left number box (for the first gridshape object) seems to have any
> effect. The size of the second gridshape object entering the xfade
> object doesn’t seem to be taken into account, even if you put the
> xfade amount to 1.
>
> Just try it and you’ll know what I’m talking about… help would be
> very much appreciated!
>
> ########################################################
>
> #P window setfont “Sans Serif” 9.;
> #P flonum 320 34 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P message 320 60 43 9109513 scale $1;
> #P flonum 367 34 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 367 60 43 9109513 scale $1;
> #P comment 8 22 85 9109513 • start rendering;
> #P comment 153 112 75 9109513 • xfade amount;
> #P window linecount 2;
> #P comment 250 230 150 9109513 jit.xfade is actually crossfading
> between two geometry matrices;
> #P comment 129 46 114 9109513 • pick two shapes and crossfade
> between them;
> #P hidden message 101 194 94 9109513 smooth_shading 1 ,
> lighting_enable 1;
> #P user jit.fpsgui 51 260 60 9109513 0;
> #P window linecount 3;
> #P newex 367 100 115 9109513 jit.gl.gridshape foo @shape sphere
> @matrixoutput 1;
> #P window linecount 1;
> #P hidden newex 66 122 50 9109513 loadbang;
> #P window linecount 3;
> #P hidden message 66 148 110 9109513 camera 3 3 3 , quad_grid ,
> smooth_shading 1 , lighting_enable 1;
> #P flonum 178 127 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0
> 0 0;
> #P window linecount 1;
> #P message 178 152 48 9109513 xfade $1;
> #P newex 246 202 52 9109513 jit.xfade;
> #P newex 7 85 43 9109513 jit.qball;
> #P number 52 38 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 7 38 15 0;
> #P newex 7 62 55 9109513 metro 20;
> #P newex 7 151 55 9109513 t b erase b;
> #P window linecount 3;
> #P newex 246 100 86 9109513 jit.gl.gridshape foo @shape torus
> @matrixoutput 1;
> #P window linecount 1;
> #P newex 8 390 80 9109513 jit.gl.render foo;
> #P newex 96 391 145 9109513 jit.window foo @depthbuffer 1;
> #P connect 5 0 4 0;
> #P connect 4 0 7 0;
> #P connect 7 0 3 0;
> #P fasten 3 1 1 0 34 345 13 345;
> #P connect 3 0 1 0;
> #P hidden fasten 11 0 1 0 71 379 13 379;
> #P connect 8 0 1 0;
> #P connect 3 2 14 0;
> #P connect 6 0 4 1;
> #P hidden connect 12 0 11 0;
> #P hidden fasten 12 0 15 0 71 144 106 144;
> #P connect 10 0 9 0;
> #P fasten 22 0 2 0 325 95 251 95;
> #P hidden connect 15 0 2 0;
> #P connect 9 0 8 0;
> #P connect 2 0 8 0;
> #P fasten 13 0 8 1 372 191 293 191;
> #P connect 23 0 22 0;
> #P connect 21 0 20 0;
> #P connect 20 0 13 0;
> #P window clipboard copycount 24;
>

#83320
Sep 6, 2006 at 8:01pm

#83321
Sep 6, 2006 at 8:40pm

Wow…

Those were fast and efficient answers, thanks a lot! One thing I’d still like to know though: Vade, how did you know about this normalize 0 feature? ‘Cause I’m using the html-references and pdf-tutorials, but I can’t see anything about that feature in there. Is there somewhere else I should be looking?

#83322
Sep 6, 2006 at 9:04pm

the archives ;)

v a d e //

http://www.vade.info
abstrakt.vade.info

On Sep 6, 2006, at 4:40 PM, Tarik wrote:

>
> Wow…
>
> Those were fast and efficient answers, thanks a lot! One thing I’d
> still like to know though: Vade, how did you know about this
> normalize 0 feature? ‘Cause I’m using the html-references and pdf-
> tutorials, but I can’t see anything about that feature in there. Is
> there somewhere else I should be looking?

#83323
Sep 6, 2006 at 9:12pm

Or you can pull up a menu that lists all supported attributes and
methods of the object by ctrl+option+click mouse on OSX and something
similar using alt I beleive on windows. I use this more than the HTML
reference.

wes

On 9/6/06, vade wrote:
>
> the archives ;)
>
>
>
>
> v a d e //
>
> http://www.vade.info
> abstrakt.vade.info
>
>
> On Sep 6, 2006, at 4:40 PM, Tarik wrote:
>
>
> Wow…
>
> Those were fast and efficient answers, thanks a lot! One thing I’d still
> like to know though: Vade, how did you know about this normalize 0 feature?
> ‘Cause I’m using the html-references and pdf-tutorials, but I can’t see
> anything about that feature in there. Is there somewhere else I should be
> looking?
>
>
>
>

#83324
Sep 6, 2006 at 9:22pm

On Sep 6, 2006, at 1:40 PM, Tarik wrote:

> Those were fast and efficient answers, thanks a lot! One thing I’d
> still like to know though: Vade, how did you know about this
> normalize 0 feature? ‘Cause I’m using the html-references and pdf-
> tutorials, but I can’t see anything about that feature in there. Is
> there somewhere else I should be looking?

Sorry about that. Have updated for the html ref and will be in the
next release.

Thanks,
Joshua

#83325

You must be logged in to reply to this topic.