can anyone help me to know the midpoint of field of view

This topic has been viewed 3672 times and has 3 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
neerajmourya
Posts: 9
Joined: Wed May 19, 2010 6:03 pm
Country: India
Contact:

can anyone help me to know the midpoint of field of view

Post by neerajmourya »

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
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: can anyone help me to know the midpoint of field of view

Post by Puybaret »

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... [:)]
Emmanuel Puybaret, Sweet Home 3D creator
neerajmourya
Posts: 9
Joined: Wed May 19, 2010 6:03 pm
Country: India
Contact:

Re: can anyone help me to know the midpoint of field of view

Post by neerajmourya »

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.
db4tech
Posts: 223
Joined: Mon May 03, 2010 5:10 pm
Country: UK

Re: can anyone help me to know the midpoint of field of view

Post by db4tech »

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
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest