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
can anyone help me to know the midpoint of field of view
This topic has been viewed 3672 times and has 3 replies
-
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
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... [:)]
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
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.
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.
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
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
Who is online
Users browsing this forum: No registered users and 1 guest