Problems positioning camera with exporter, utnits may be dif

General discussion regarding exporter development in general.

Moderators: Ratow, coordinators

Re: Problems positioning camera with exporter, utnits may be

Postby Lord Crc » Sat Dec 17, 2011 6:02 am

Ah yes, I thought something like this may be the case.

You could try the following. It will use the camera/object matrix as is, but then swap z and y, as well as multiply the new y with -1. The first matrix does this job (which is applied last). We then multiply it with the original matrix using ConcatTransform.

Code: Select all
   outputstream << "Transform [" <<
       " 1.0 0.0 0.0 0.0 " <<
       " 0.0 0.0 1.0 0.0 " <<
       " 0.0 -1.0 0.0 0.0 " <<
       " 0.0 0.0 0.0 1.0]" << std::endl;

   outputstream << "ConcatTransform [" <<
       m[0][0] << " " << m[1][0] << " " << m[2][0] << " 0.0 " <<
       m[0][1] << " " << m[1][1] << " " << m[2][1] << " 0.0 " <<
       m[0][2] << " " << m[1][2] << " " << m[2][2] << " 0.0 " <<
       m[0][3] << " " << m[1][3] << " " << m[2][3] << " 1.0]" << std::endl;


You might want to play with the sign there, either removing it or putting it on the other 1 instead (the one on the row above and to the right).

If this works then you'll need to do this for all objects you export.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4455
Joined: Sat Nov 17, 2007 2:10 pm

Re: Problems positioning camera with exporter, utnits may be

Postby rasikrodri » Sun Dec 18, 2011 6:03 pm

Now the camera rotation x is perfect but still the y and z do not appear to be swaped! they have not changed!
rasikrodri
 
Posts: 24
Joined: Sat Apr 10, 2010 1:26 pm

Re: Problems positioning camera with exporter, utnits may be

Postby rasikrodri » Mon Dec 19, 2011 4:56 pm

Why is it so complicated to give LuxRender the transformations. I does not work still!
rasikrodri
 
Posts: 24
Joined: Sat Apr 10, 2010 1:26 pm

Re: Problems positioning camera with exporter, utnits may be

Postby Lord Crc » Mon Dec 19, 2011 6:16 pm

I understand your frustration, I wish I could be of more help, however they don't seem to have a demo of Animation Master, and in any case I don't have access to Visual Studio 6 :(

I'm going over the math once more, I may have made a mistake.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4455
Joined: Sat Nov 17, 2007 2:10 pm

Re: Problems positioning camera with exporter, utnits may be

Postby paco » Mon Dec 19, 2011 6:24 pm

Lord Crc wrote: I wish I could be of more help


Looks like you've already gone above and beyond! You're a great asset LordCrc :D
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: Problems positioning camera with exporter, utnits may be

Postby rasikrodri » Tue Dec 20, 2011 5:41 am

paco is wrigth!
You have gone farther than I thougth someone in the forum would go.
I really apreciate your help!
rasikrodri
 
Posts: 24
Joined: Sat Apr 10, 2010 1:26 pm

Re: Problems positioning camera with exporter, utnits may be

Postby rasikrodri » Tue Dec 20, 2011 5:47 am

Just to reafirm that the info I gave you is correct I tested the x,y and z rotation again:

I tested each value independently, having the other rotation values in 0, pluss the translation in 0.
X in Animation Master rotates the same in LuxRender
Y in Animation Master rotates the camera to the sides, in LuxRender spins it
Z in Animation Master spins the camera, in LuxRender rotates the camera to the sides

Thanks
rasikrodri
 
Posts: 24
Joined: Sat Apr 10, 2010 1:26 pm

Re: Problems positioning camera with exporter, utnits may be

Postby Lord Crc » Tue Dec 20, 2011 5:48 am

Great, I'll be home tonight, I'll try to figure it out then :)
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4455
Joined: Sat Nov 17, 2007 2:10 pm

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest