POV-Ray : Newsgroups : povray.general : Camera confusion Server Time
2 Aug 2024 14:19:52 EDT (-0400)
  Camera confusion (Message 1 to 7 of 7)  
From: ShiJie
Subject: Camera confusion
Date: 25 Oct 2004 03:55:00
Message: <web.417cb11d952bf6174727610@news.povray.org>
Dear NG,

I am a bit confuse about using the camera I would appreciate it if someone
would guide me. I have an object which is I think place on coordinates
<0,0,0>. Now this object is a bit complicated and I would like to view it
on its back,front and each of its side view, one way is of course to rotate
the object and view it (but I think this will take more rendering time and
besides its a bit more complicated) and the easier way is just to place the
a camera on the right position to view the objects front, back, left and
right side views (ie. If I understood the purpose of the "camera" in PovRay
correctly). I chose the latter option. I have the following camera code in
the beginning of my Pov file:

 camera {
  location <0, .1, -25>
  //location <-25, .1, 0>
  look_at 0
  //look_at <25,.1,0>
  angle 30
  //direction <5,1,1>
  // rotate y*70
  }

As you can see from the commented codes, I tried to experiment a lot to see
if I can do this. But I am really not able to do it! I thought that if I
reversed the z and the x coordinates in the location then I can get the
left-view of the object. This is not happening! I just get a blank space
and the camera doesn't even seem to have "faced right" to view the leftside
of the object. I tried doing other experiments with direction and look_at,
but I am really confused. I either misunderstand camera or I am doing this
wrongly.

I appreciate any help. Thanks in advance!



Sincerely,
Jose Capco

PS

I have
           Backside

          -------------
Leftside |   OBJECT    | Rightside
          ------------

           Frontside=where camera is now placed (I think!)

and I want to see Leftside, Backside.. etc.


Post a reply to this message

From: Renderdog
Subject: Re: Camera confusion
Date: 25 Oct 2004 05:20:00
Message: <web.417cc4cce6ce824a7b871e2a0@news.povray.org>
It looks like you just didn't hit on the right combination;
also there are some default values that may be causing
problems.

Here's some code for four side views. There are several
different ways to get the same view so someone may
come up with a better combination, but I used "right" and
"direction" to aim the cameras here.

I'm no expert and I'm also confused by the camera.
I would expect the look_at vector to rotate the camera
about the sky vector without needing to change the
direction, but if I don't change the direction in the below
cameras the image is mirrored. The look_at vector
in my cameras does nothing?

/*
DEFAULT CAMERA: (If you don't declare these variables)

camera {
 perspective
 location <0,0,0>
 direction <0,0,1>
 right 1.33*x
 up y
 sky <0,1,0> }

direction:
It tells POV-Ray the initial direction to point the camera before
moving it with the look_at or rotate vectors

*/

#declare ViewDir = 2;   //  0 Front, 1 Rear, 2 Right, 3 Left

#if ( ViewDir = 0 )
 camera {
  location <0, .1, -25>
  right x*image_width/image_height
  angle 30
  look_at 0  //  always last
     }
#end

//  Rear view

#if ( ViewDir = 1 )
 camera {
  location <0, .1, 25>
  direction <0,0,-1>  //  Mirrored without this
  right -x*image_width/image_height
  angle 30
  look_at 0
     }
#end

//  Right

#if ( ViewDir = 2 )
 camera {
  location <25, .1, 0>
  direction <-1,0,0>  //  Mirrored without this
  right z*image_width/image_height
  angle 30
  look_at 0
     }
#end

//  Left

#if ( ViewDir = 3 )
 camera {
  location <-25, .1, 0>
  direction <1,0,0>  //  Mirrored without this
  right -z*image_width/image_height
  angle 30
  look_at 0
     }
#end


Post a reply to this message

From: Warp
Subject: Re: Camera confusion
Date: 25 Oct 2004 05:29:36
Message: <417cc780@news.povray.org>
You should post a complete (but small) scene demonstrating your problem.
It's hard to say what's wrong without actually seeing the scene.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Lazarus Plath
Subject: Re: Camera confusion
Date: 25 Oct 2004 05:32:40
Message: <qqazxxsw-9C6688.04323725102004@news.povray.org>
In article <web.417cb11d952bf6174727610@news.povray.org>,
 "ShiJie" <jca### [at] yahoocom> wrote:

> I just get a blank space
> and the camera doesn't even seem to have "faced right" to view the leftside
> of the object.

A few things come to mind that you didn't specify..
Is there a light in the scene?
If so is the light inside your object?
Is the object textured?
Are you sure the object is at the origin and that it's less than 20 
units?
Is the object visible? (ie blobs with no surface or intersection with no 
intersection)

-few


Post a reply to this message

From: Alain
Subject: Re: Camera confusion
Date: 25 Oct 2004 05:54:07
Message: <417ccd3f$1@news.povray.org>
ShiJie nous apporta ses lumieres ainsi en ce 2004-10-25 03:54... :

>Dear NG,
>
>I am a bit confuse about using the camera I would appreciate it if someone
>would guide me. I have an object which is I think place on coordinates
><0,0,0>. Now this object is a bit complicated and I would like to view it
>on its back,front and each of its side view, one way is of course to rotate
>the object and view it (but I think this will take more rendering time and
>besides its a bit more complicated) and the easier way is just to place the
>a camera on the right position to view the objects front, back, left and
>right side views (ie. If I understood the purpose of the "camera" in PovRay
>correctly). I chose the latter option. I have the following camera code in
>the beginning of my Pov file:
>  
>
Rotating the camera or the object takes the same time, virtualy no extra 
time. In your case, you could rotate the object to get the different 
wiews. In my view, it's not more complicated. I routinely have my 
objects deffined in a #define block. I then place it with:
object{MyObject rotate <x,y,z> translate<x,y,z>}

Alain


Post a reply to this message

From: Warp
Subject: Re: Camera confusion
Date: 25 Oct 2004 06:10:37
Message: <417cd11c@news.povray.org>
Alain <aze### [at] qwertygov> wrote:
> Rotating the camera or the object takes the same time, virtualy no extra 
> time.

<advanced>
  Actually that depends on whether POV-Ray creates a transformation matrix
for the object/camera or not.
  Sometimes an object (and I suppose the camera as well) can be transformed
and a transformation matrix will not be created for it if it's not
necessary (one example: If you translate a sphere, POV-Ray will just
modify the center of the sphere instead of creating a transformation
matrix).
  Theoretically rendering an object without a transformation matrix should
be slightly faster than one with such matrix.
  However, I suppose the speed difference is so minimal it usually doesn't
matter.
</advanced>

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: pan
Subject: Re: Camera confusion
Date: 25 Oct 2004 08:19:06
Message: <417cef3a@news.povray.org>
"ShiJie" <jca### [at] yahoocom> wrote in message
news:web.417cb11d952bf6174727610@news.povray.org...
> Dear NG,
>
> I am a bit confuse about using the camera I would appreciate it if someone
> would guide me. I have an object which is I think place on coordinates
> <0,0,0>. Now this object is a bit complicated and I would like to view it
> on its back,front and each of its side view, one way is of course to
rotate
> the object and view it (but I think this will take more rendering time and
> besides its a bit more complicated) and the easier way is just to place
the
> a camera on the right position to view the objects front, back, left and
> right side views

this bit of code might be helpful
just change the rotation angles to view different aspects of scene
this will help understanding povray coordinate system

#declare camera_angle  = 50;
#declare camera_location    = <100.00, 0.0, 0.0>;
#declare camera_rotation_x  =    23;  // degrees of rotation around x axis
#declare camera_rotation_y  =    -45; // degrees of rotation around y axis
#declare camera_rotation_z  =    0;  // degrees of rotation around z axis

/*  redefine camera location according to desired axial rotations about
origin (<0,0,0> */
#declare camera_location    = vrotate(camera_location,
<camera_rotation_x,camera_rotation_y,camera_rotation_z>);
#declare camera_look   = <0.00, 0.00, 0.00>; // focus point for scene


#ifndef(camera_angle)
 camera{location camera_location look_at  camera_look}
#else
 camera{location camera_location look_at  camera_look angle camera_angle}
#end
/* if you add this light source, the scene will always be lighted */
/* remove it or change it later */
light_source{camera_location color rgb <1.00, 1.00, 1.00>}

it would be easy enough to define a vector rotation for the camera relative
to the
camera look at point (or any other point), but I'll leave that as an
exercise for the reader

/* example of additional useful declaration    distance of camera from
origin */
#declare camera_length_2origin    =
vlength(<camera_location.x,camera_location.y,camera_location.z>);
/* example of additional useful declaration    distance of camera from look
at point */
#declare camera_length_2look_at    = vlength(
<camera_location.x,camera_location.y,camera_location.z> , camera_look);

pan


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.