[tuhopuu-devel] detail slipped in UV calculation
BjornMose
tuhopuu-devel@blender.org
Tue, 23 Dec 2003 01:32:33 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_000F_01C3C8F4.A360A060
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
hello all
hello theeth=20
1.
sorry about this, but there is one thing (hope no other) that slipped =
when i was analyzing the code:
the object in which the mesh is embedded can define a rotation too.
the line
Mat4MulMat4(finalmatrix,tempmatrix,ob->obmat);
in the following patch
will take care ( had to do a little finalmatrix tempmatrix acrobatics =
since Mat4MulMat4(m1,m1.m2) scrambles m1 during calculation)
BTW is there hope for a C++ style "m1 *=3D m2;" for matrix operations?
as far as i know standard template library (STL) supports this.
2.
for x-mas cookie i streamlined the "centermode" code and added the =
"object center" option.
do you think the "median" option should be coded too ?
Index: source/blender/src/editface.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/tuhopuu/tuhopuu2/source/blender/src/editface.c,v
retrieving revision 1.2
diff -r1.2 editface.c
899c899
< /* check if we can do this */
---
> /* check if we can do this and do it otherways tell the user we =
can't*/
902,911c902
< case 0 : /*bounding box center*/
< case 1 : /*cursor center*/
< break; /* is ok */
< default : /* other modes are not supported yet */
< /* say something to the user if we can't*/
< okee("this operation center does not work here!");
< return;=20
< }
< if (centermode =3D=3D 0) /* calculate bounding box */
< {
---
> case 0 : /*bounding box center*/
913d903
<=20
919c909
<=20
---
> =20
926c916
<=20
---
> =20
928,930c918,929
< }
< else /* center is the current 3d cursor */
< {=20
---
> break;
> =20
> case 1 : /*cursor center*/=20
> {=20
> float *cursx;
> cursx=3D give_cursor();
> /* shift to objects world */
> cent[0]=3D cursx[0]-ob->obmat[3][0];
> cent[1]=3D cursx[1]-ob->obmat[3][1];
> cent[2]=3D cursx[2]-ob->obmat[3][2];
> }
> break;
932,937c931,940
< float *cursx;
< cursx=3D give_cursor();
< /* shift to objects world */
< cent[0]=3D cursx[0]-ob->obmat[3][0];
< cent[1]=3D cursx[1]-ob->obmat[3][1];
< cent[2]=3D cursx[2]-ob->obmat[3][2];
---
> case 2 : /*object center*/=20
> {
> cent[0]=3D cent[1]=3D cent[2]=3D 0.0;
> }
> break;
> =20
> default : /* other modes are not supported yet */
> /* say something to the user if we can't*/
> okee("this operation center does not work here!");
> return;=20
939c942
<=20
---
> =20
970,971c973,976
< Mat4MulMat4(tempmatrix,viewmatrix,rotup);
< Mat4MulMat4(finalmatrix,tempmatrix,rotside);
---
> /* calculate transforms */
> Mat4MulMat4(finalmatrix,viewmatrix,rotup);
> Mat4MulMat4(tempmatrix,finalmatrix,rotside);
> Mat4MulMat4(finalmatrix,tempmatrix,ob->obmat);
------=_NextPart_000_000F_01C3C8F4.A360A060
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hello all<BR>hello theeth =
<BR>1.<BR>sorry about=20
this, but there is one thing (hope no other) that slipped when i was =
analyzing=20
the code:<BR>the object in which the mesh is embedded can define a =
rotation=20
too.<BR>the=20
line<BR> Mat4MulMat4(finalmatrix,tempmatrix,ob->obmat=
);<BR>in=20
the following patch<BR>will take care ( had to do a little finalmatrix=20
tempmatrix acrobatics since Mat4MulMat4(m1,m1.m2) scrambles m1 during=20
calculation)<BR>BTW is there hope for a C++ style "m1 *=3D m2;" for =
matrix=20
operations?<BR>as far as i know standard template library (STL) supports =
this.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>2.<BR>for x-mas cookie i streamlined =
the=20
"centermode" code and added the "object center" option.<BR>do you think =
the=20
"median" option should be coded too ?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Index:=20
source/blender/src/editface.c<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<BR>RCS=20
file: =
/cvsroot/tuhopuu/tuhopuu2/source/blender/src/editface.c,v<BR>retrieving=20
revision 1.2<BR>diff -r1.2 editface.c<BR>899c899<BR>< /* =
check if=20
we can do this */<BR>---<BR>> /* check if we can do this =
and do=20
it otherways tell the user we can't*/<BR>902,911c902<BR><=20
case 0 : /*bounding box center*/<BR><=20
case 1 : /*cursor center*/<BR><=20
break; /* is ok */<BR>< =
default :=20
/* other modes are not supported yet */<BR>< =
/* say=20
something to the user if we can't*/<BR>< =
okee("this=20
operation center does not work here!");<BR>< =
return;=20
<BR>< }<BR>< if (centermode =3D=3D 0) /* =
calculate=20
bounding box */<BR>< {<BR>---<BR>> =
case 0 :=20
/*bounding box center*/<BR>913d903<BR>< <BR>919c909<BR>< =
<BR>---<BR>>=20
<BR>926c916<BR>< <BR>---<BR>>=20
<BR>928,930c918,929<BR>< }<BR><=20
else /* center is the current 3d cursor */<BR>< =
{=20
<BR>---<BR>> break;<BR>> =
<BR>>=20
case 1 : /*cursor center*/ <BR>> =
{=20
<BR>> float *cursx;<BR>>=20
cursx=3D give_cursor();<BR>> =
/*=20
shift to objects world */<BR>> cent[0]=3D=20
cursx[0]-ob->obmat[3][0];<BR>> cent[1]=3D=20
cursx[1]-ob->obmat[3][1];<BR>> cent[2]=3D=20
cursx[2]-ob->obmat[3][2];<BR>> }<BR>>=20
break;<BR>932,937c931,940<BR>< =
float=20
*cursx;<BR>< cursx=3D give_cursor();<BR><=20
/* shift to objects world */<BR><=20
cent[0]=3D cursx[0]-ob->obmat[3][0];<BR><=20
cent[1]=3D cursx[1]-ob->obmat[3][1];<BR><=20
cent[2]=3D cursx[2]-ob->obmat[3][2];<BR>---<BR>> =
case 2 : /*object center*/ <BR>>=20
{<BR>> cent[0]=3D =
cent[1]=3D cent[2]=3D=20
0.0;<BR>> }<BR>> =
break;<BR>>=20
<BR>> default : /* other modes are not=20
supported yet */<BR>> /* say something to the user =
if we=20
can't*/<BR>> okee("this operation center does not =
work=20
here!");<BR>> return; <BR>939c942<BR><=20
<BR>---<BR>> <BR>970,971c973,976<BR><=20
Mat4MulMat4(tempmatrix,viewmatrix,rotup);<BR><=20
Mat4MulMat4(finalmatrix,tempmatrix,rotside);<BR>---<BR>>=20
/* calculate transforms */<BR>>=20
Mat4MulMat4(finalmatrix,viewmatrix,rotup);<BR>>=20
Mat4MulMat4(tempmatrix,finalmatrix,rotside);<BR>>=20
Mat4MulMat4(finalmatrix,tempmatrix,ob->obmat);<BR></FONT><=
/DIV></BODY></HTML>
------=_NextPart_000_000F_01C3C8F4.A360A060--