POV-Ray : Newsgroups : povray.general : Cammera Question : Re: Camera Question Server Time
7 Aug 2024 23:22:54 EDT (-0400)
  Re: Camera Question  
From: Mr  Art
Date: 16 Aug 2001 22:03:48
Message: <3B7CB3F2.D59CB078@chesapeake.net>
Rune wrote:
> He would write:
> 
> union {
>    union {
>       object {...}
>       object {...}
>       scale Non_Uniformly
>    }
>    camera {...}
> }

Hadn't thought of that. Good point.

I thought of another something for a camera that might make anims a lot
easier: a "lock-on" function that allows you to look at a location
regardless of how the camera gets rotated. This is not as redundant
as it might first sound. If the camera was allowed in unions and the
union was rotated, the direction that the camera looks would no longer
be as was set with look_at, it would be adjusted by the rotation. This 
could be a desired result. But to set the camera to look at what you
had hoped to view from your new viewpoint might be a bit tough.
So lets imagine two vector functions:
	set_marker: would designate a vector variable as a marker.
	get_marker: would return the position of a marker variable. 
and an optional keyword for the camera statement:
	maybe it could be called "lock_on <vector>". 

The marker might work like this:
	set_marker{ markername }
	the point that is marked is the local
	<0,0,0> of the object it is unioned to as it was built.
	The named point would then have all scales,
	rotations, and translations applied.
	
	get_marker( markername )
	the vector returned is the position of the marker
	with whatever positional transformations applied.


#declare Position_marker1=<0,0,0>;// name a vector for use.

#declare some_good_looking_object_walking_by =
union	{
	object	{...}
	object	{...}
	set_marker {Position_marker1}
	}

#declare someobject=
union	{
	union	{
		object	{...}
		object	{...}
		scale	Non_Uniformly
		}
	camera	{...lock_on get_marker(Position_marker1) }
	}
 
I know that the camera can be specified anywhere in the files for a
scene, but I
don't know when it gets evaluated. For a camera to work as envisioned
here the 
camera would have to be evaluated last. This would give the program the
chance
to get all needed information to evaluate the marker variables. The
camera statement
could still come anywhere in the source, it would just be dealt with
last.


Post a reply to this message

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