Guide For Exporter Writers

A forum for exporter development discussion.
User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Wed Oct 24, 2007 9:35 pm

Added a ' General procedure for setting the camera settings' section.

User avatar
fused
Developer
Posts: 3648
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Post by fused » Wed Oct 24, 2007 9:38 pm

nice. thank you!

finally a "camera for dummies" :)

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Post by Whaat » Mon Oct 29, 2007 3:14 pm

Hey Indigo people!

What's a good default pre-scale value? SkIndigo has been using 6.0 for a long time and I am starting to notice that most the of renders uploaded by new SkIndigo users look like the pre-scale is set too high.

I think the reason I set it so high is because my old computer had a really dark monitor and I had to use a higher pre-scale value for the render to look right. Now, when I see renders on my new laptop and my computer at work, they look too bright.

Maybe a value of 4.0 (like Blendigo) is the way to go. It should be a value that will give a good render for a variety of lighting situations.

Does anyone find Blendigo's default value of 4.0 too low? Too high?

Thanx.

User avatar
Zom-B
1st Place 100
Posts: 4700
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

Post by Zom-B » Mon Oct 29, 2007 9:16 pm

Whaat wrote:What's a good default pre-scale value?
3/1/10 for reinhard is cool on all my three CRT's (but violets reinhard settings are way brighter using this values :?: ).
polygonmanufaktur.de

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Oct 30, 2007 12:10 am

Violet's values are logarithmic, I think...
Someone, I can't remember, who, programmed it like that, so that a post scale value change of 1 will cause the histogram to be one stop brighter or darker ;)

User avatar
CoolColJ
Posts: 1734
Joined: Mon Jun 25, 2007 1:47 pm

Post by CoolColJ » Tue Oct 30, 2007 9:44 am

In Voilet 0=1 in Indigo

I tend to use a burn of 5, 4 will kinda burn out, but it changes from render to render. I hate Reinhart anyway, looks too "grey" :)

User avatar
Ana028
Posts: 44
Joined: Fri Apr 27, 2007 1:35 am

Post by Ana028 » Fri Nov 02, 2007 12:32 am

Hi all, I have a question about how can I calc the aperture radius

I have a camera with 24mm focal lenght, zoom factor 3.2, focal dis 1 and camera f-stop 4.

Code: Select all

We have
N = f / d
where
N = f-number, f = focal length, d = aperture diameter.
Therefore
r = f / (N*2)
where
r = aperture radius. 
I don't understand very good this. How can I calc the aperture radius with my values ?

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Fri Nov 02, 2007 12:58 am

Here is how I do it for Maxigo:

Code: Select all

f-stop = 4
sensor_width = 0.035
sensor_distance = sensor_width / (2*tan(cameraFOV/2))
aperture_radius = sensor_distance / ( f-stop * 2) 

User avatar
Ana028
Posts: 44
Joined: Fri Apr 27, 2007 1:35 am

Post by Ana028 » Fri Nov 02, 2007 1:06 am

Thanks, :wink:

bkircher
Posts: 115
Joined: Thu Nov 23, 2006 6:24 am

Post by bkircher » Fri Nov 02, 2007 7:01 pm

While trying to write Rotation Matrixes for the MayaToIndigo exporter,
well, we got stuck. I checked the Skindigo tool but couldn't find any reference to rotation code.

As this will eventually concern every exporter that generates instances or that will implement efficient transformation-based animations, can somebody shed some light on this?

Here is the baby-code for generating rotation matrixes, or at least some starting point. I imagine it will be something similar for other programming / script languages.

Code: Select all

$x = `getAttr locator1.rx`; 
$y = `getAttr locator1.ry`; 
$z = `getAttr locator1.rz`; 

float $xCos = cos (deg_to_rad($x)); 
float $xCo_ = -1 * `cos (deg_to_rad($x))`; 
float $xSin = `sin (deg_to_rad($x))`; 
float $xSi_ = -1 * `sin (deg_to_rad($x))`; 

float $yCos = `cos (deg_to_rad($y))`; 
float $yCo_ = -1 * `cos (deg_to_rad($y))`; 
float $ySin = `sin (deg_to_rad($y))`; 
float $ySi_ = -1 * `sin (deg_to_rad($y))`; 

float $zCos = `cos (deg_to_rad($y))`; 
float $zCo_ = -1 * `cos (deg_to_rad($y))`; 
float $zSin = `sin (deg_to_rad($y))`; 
float $zSi_ = -1 * `sin (deg_to_rad($y))`; 


matrix $mx[3][3] = << 1 , 0 , 0 ; 
            0 , $xCos, $xSi_; 
            0 , $xSin, $xCos>>; 
            
matrix $my[3][3] = << $yCos , 0 , $ySin ; 
            0 , 1, 0 ; 
            $yCo_ , 0, $yCos>>; 

matrix $mz[3][3] = << $zCos , $zSi_ , 0 ; 
            $zSin , $zCos, 0; 
            0 , 0, 1>>; 

matrix $mAll[3][3] = $mx * $my * $mz; 

print "\nrotation Matrix:"; 
print $mAll; 

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Sat Nov 03, 2007 2:05 am

And as a reference, the latest version wich works only for rotations around up axis.

Code: Select all

				float $xCos = cos (deg_to_rad($rix)); 
				float $xCo_ = -1 * `cos (deg_to_rad($rix))`; 
				float $xSin = `sin (deg_to_rad($rix))`; 
				float $xSi_ = -1 * `sin (deg_to_rad($rix))`; 
				
				float $yCos = `cos (deg_to_rad($riy))`; 
				float $yCo_ = -1 * `cos (deg_to_rad($riy))`; 
				float $ySin = `sin (deg_to_rad($riy))`; 
				float $ySi_ = -1 * `sin (deg_to_rad($riy))`; 
				
				float $zCos = `cos (deg_to_rad($riz))`; 
				float $zCo_ = -1 * `cos (deg_to_rad($riz))`; 
				float $zSin = `sin (deg_to_rad($riz))`; 
				float $zSi_ = -1 * `sin (deg_to_rad($riz))`;

				matrix $R0[3][3] = << $zCos , $zSi_ , 0 ; 
				            $zSin , $zCos, 0; 
				            0 , 0, 1>>; 

				matrix $Rx[3][3] = << 1 , 0 , 0 ; 
				            0 , $xCos, $xSi_; 
				            0 , $xSin, $xCos>>; 
				            
				matrix $R1[3][3] = << $yCos , $ySi_ , 0 ; 
				            $ySin , $yCos, 0; 
				            0 , 0, 1>>;  
				
				
				matrix $Rresult[3][3] = $R1 * $Rx;
				matrix $Rresult[3][3] = $Rresult * $R0;
				
				print $Rresult;

				matrix $RtoY [3][3] = <<1, 0, 0;
										0, 0, -1;
										0, 1, 0>>;
				if ($upAxis == "y")
				{
					$Rresult = $Rresult * $RtoY;
				}
This approach is as follows (Z up):

1° Rotation around Z
2° Rotation aroun X
3° Second rotation around Z

Here I can't define the value for the second rotation around Z, I'm using Y rot value but seems wrong.

Indeed we need help. Thanks.
obsolete asset

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sat Nov 03, 2007 2:48 am

Why are you doing this manually?
Can't you get a nice rotation/transform matrix out of Maya?

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Post by Whaat » Sat Nov 03, 2007 2:55 am

suvakas wrote:Why are you doing this manually?
Can't you get a nice rotation/transform matrix out of Maya?
Yeah, it's EZ with SketchUp API.

Code: Select all

trans=entity.transformation
Done!

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Sat Nov 03, 2007 7:02 am

I can't answer your question suvakas, as the code I expose here is from someone's else algorithm and it appeared that afternoon that he hadn't the problem clear in mind so the algorithm is finally not suitable.

I do ignore almost everything about rotation matrices...

Anyhow the "how" is not the point here, we need to know the right composition of the RM and their multiplication order, if I understood enough. Thought you guys had cracked that easily...

That said, suvakas, that was a good question. Inquiring now...

>> Indeed every object has:

- matrix
- world matrix
- parent matrix

and each of these has an inverse matrix also available as output. bkircher, maybe we have been fooled...
obsolete asset

bkircher
Posts: 115
Joined: Thu Nov 23, 2006 6:24 am

Post by bkircher » Sat Nov 03, 2007 11:45 am

Sadly, we can't.
But the Maya Help is great in that respect:

Code: Select all

              -1                      -1
   matrix = SP * S * SH * SP * ST * RP * RA * R * RP * RT * T
a little further down the line, it is said:

Code: Select all

RX = |  1    0    0    0 |     RY = |  cy   0   -sy   0 |
                                 |  0    cx   sx   0 |          |  0    1    0    0 |
                                 |  0   -sx   cx   0 |          |  sy   0    cy   0 |
                                 |  0    0    0    1 |          |  0    0    0    1 |

                        RZ = |  cz   sz   0    0 |     sx = sin(rx), cx = cos(rx)
                                 | -sz   cz   0    0 |     sy = sin(ry), cx = cos(ry)
                                 |  0    0    1    0 |     sz = sin(rz), cz = cos(rz)
                                 |  0    0    0    1 |
, and well, that's it, basically.

Maya is thinking Y-up to my experience: In a Z-up environment, probably a XYZ rotation order with Y up is part of the problem?
(We can get the world 4x4 matrix, does this help ?)
Any help is appreciated on this issue...

Post Reply
64 posts

Who is online

Users browsing this forum: No registered users and 2 guests