Exporter for Eyeshot from Devdept

Announcements, information, requests and support regarding other exporters and general/new exporters
Post Reply
4 posts • Page 1 of 1
Heinz
Posts: 3
Joined: Mon May 14, 2012 10:38 pm

Exporter for Eyeshot from Devdept

Post by Heinz » Mon May 14, 2012 11:08 pm

Hello,

I am currently working on an XML exporter for Eyeshot.
www.devdept.com

Now I have a question regarding the camera properties.

In Eyeshot there are the following camera parameters:

AngelOfView - Gets the camera vertical angle of view (in degrees)
Distance - gets or sets the distance between camera an target point.
Far - Gets the far clipping plane position
FirstPerson - If true, enables camera rotation on location (eye) point.
FocalLength - Gets or sets the camera focal length. Applies only to Perspective projection mode
Location - Gets or sets the camera location (eye) point.
LocationWithoutOffset
Near - Gets the near clipping plane postion.
ProjectionMode - Gets or sets the camera projection mode
Rotation - 3D rotation
Target - Gets or sets camera aiming point.
ZoomFactor - Gets or sets the current zoom factor. Applies only to Orthographic projection mode.

Currently I just use these 4 parameters for the export:

Location -> Pos
Target -> forwards
Rotation -> up
FocalLenght ->lens_sensor_dist


Now these are the exportet camera parameters like I understand it:

<camera>
<forwards>
0 0 -7.10542735760111 // Target in Eyeshot
</forwards>
<aperture_radius>
0.00218750002845326
</aperture_radius>
<focus_distance>
10.0
</focus_distance>
<pos>
3.52357077516967 -6.10300360665872 4.06866907110581 // Location in Eyeshot
</pos>
<up>
0.12940952255126 0.224143868042013 0.4892962913144534 // Rotation in Eyeshot
</up>
<aspect_ratio>
1.7777777777777777
</aspect_ratio>
<white_balance>
E
</white_balance>
<exposure_duration>
0.008
</exposure_duration>
<lens_sensor_dist>
0.050 // Focal lenght in Eyeshot (50)
</lens_sensor_dist>
<autofocus/>
<sensor_width>
0.032
</sensor_width>
</camera>

In the center is the small box from Blender's standard scene. At least, should be.
Now obviously my current understanding of camera parameters is wrong.
But after trying out a lot, I can not find the error. That's why I ask if somebody could
help me out with this.

Thanks a lot.
Kind regards,
Heinz

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

Re: Exporter for Eyeshot from Devdept

Post by fused » Tue May 15, 2012 12:29 am

Hi Heinz,

great to hear that you are working on an exporter! You should contact us directly so we can talk about it: support (at) indigorenderer (dot) com.

Regarding you problems with the camera:

First of all, in Indigo, Z is the up axis (if Devdepot has Y up, or any other, this might cause some problems).

The forwards vector should be the vector from the camera to the target, not just the target point. You can do that by subtracting the Location of the Target (Target - Location).

The rotation is in euler angles? Rotation axis and an angle? In this case you need to calculate the up vector.
For a start you could just use 0 0 1, which means you camera cant be rotated sideways, but at least it gives you some good results quickly.

Regarding all the other camera option, see this forum post: http://www.indigorenderer.com/forum/vie ... =25&t=1106

Note that the camera diagram is top down and the formula expects the horizontal angle of view.

Since you have the vertical angle of view you need to do it slightly differently.
You could either calculate the horizontal angle of view or instead use the sensor height and the vertical angle of view in the formula (recommended). The sensor height is the sensor width divided by the aspect ratio.

You need to solve it for L, which should give you (someone please correct me if I am completely wrong):

L = 0.5 * (h / tan(0.5 * a))

where:

h = sensor height
L = lens-sensor dist
a = vertical angle of view

Heinz
Posts: 3
Joined: Mon May 14, 2012 10:38 pm

Re: Exporter for Eyeshot from Devdept

Post by Heinz » Tue May 15, 2012 9:05 pm

Hi fused,

thank's al lot for your help. Still need some finetuning on my side, but looks
much better now. I realised, that I have to dive much deeper into the world
of vectors and matrices. :D

Kind regards,
Heinz

Heinz
Posts: 3
Joined: Mon May 14, 2012 10:38 pm

Re: Exporter for Eyeshot from Devdept

Post by Heinz » Tue May 15, 2012 10:03 pm

Solved! :D

It really makes sense to know about vectors when working with them :-)

Solution:

Target is a point.
Location is a point.
Forwards is a Vector.

This is my function in C#

private void getForwards(Point3D Target, Point3D Location)
{
Forwards.X = (float)(Target.X - Location.X);
Forwards.Y = (float)(Target.Y - Location.Y);
Forwards.Z = (float)(Target.Z - Location.Z);
}


Thank's again !!
Heinz

Post Reply
4 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 21 guests