So konvertieren Sie den Kameraraum in den Weltraum mit Kameravektor und Rayvektor im KameraraumC++

Programme in C++. Entwicklerforum
Anonymous
 So konvertieren Sie den Kameraraum in den Weltraum mit Kameravektor und Rayvektor im Kameraraum

Post by Anonymous »

Wie kann ich einen Kamera -Space -Vektor in den Weltraum des Kamera und den Vektor der Kamera -Speicherplatz umwandeln?

Code: Select all

std::vector calculate_ray_heading(std::vector input_vector, double fov, std::vector uv) {
// Calculate the heading of the ray in world space given
//  -camera vector (world space)
//  -uv (converted to camera normalized device coordinates)
//  -fov (ignored for now)

//convert uv2 to NDC (normalized device coordinates)
// changes range from [0,-1] to [-1,1]
std::vector ndc = {
(2*uv[1]) - 1,
(2*(1-uv[0])) - 1
};

//calculate ray heading in camera space
std::vector cam_space = normalize_vector(
{
1, ndc[0], ndc[1]
}
);

//convert cam space to world space
//...

//return world space
return world_space;
};
Beachten Sie auch>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post