Print at Dec 20, 2025, 2:27:00 PM View all posts in this thread on one page
Posted by neerajmourya at May 25, 2010, 10:29:08 AM
can anyone help me to know the midpoint of field of view
Hello everyone,First of all sorry for my english as i am learning English.
I am trying to write a plugin for yafaray export. i have a problem. Yafaray calculates the direction of camera using two points in the scene. one is the position of camera itself and other point is used to determine the direction. i can get position of camera using getX(), getY(), and getZ() method of Camera class in Sweethome3d. but how can i get the other point.
There is a getFieldOfView() method in Camera class. if i can get mid point of field of view then problem may solve. but how to calculate the midpoint.

Thanks in advance

Posted by Puybaret at May 25, 2010, 12:28:06 PM
Re: can anyone help me to know the midpoint of field of view
You should compute the direction from the yaw and pitch angles of the camera.
See PhotoRenderer.java to help you compute the matching direction.

The source code of PhotoRenderer and OBJWriter classes should help you to see how to build the Yafaray data matching Java 3D nodes.
I hope you'll be able to get a nice plug-in... smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by neerajmourya at May 25, 2010, 1:34:21 PM
Re: can anyone help me to know the midpoint of field of view
Thanks PuyBaret for reply.

The resources you provided proved helpful for me. I also got solution to my problem under the PhotoRenderer.java:

// Set the point the camera is pointed to
Point3 target = new Point3(
camera.getX() - (float)(Math.sin(yaw) * pitchCos),
camera.getZ() - (float)Math.sin(pitch),
camera.getY() + (float)(Math.cos(yaw) * pitchCos));
Vector3 up = new Vector3(0, 1, 0);
transform = Matrix4.lookAt(eye, target, up);

I am trying to understand more these classes.

thanks again.

Posted by db4tech at Jun 12, 2010, 12:12:01 AM
Re: can anyone help me to know the midpoint of field of view
Hi neerajmourya,

Do you have any progress information on your Yafaray export plug-in?
As an end user I would be very interested in seeing any Sweet Home Yafaray rendering results.

db4tech