POV-Ray : Newsgroups : povray.binaries.scene-files : Trace: How to work together with Rotate Server Time
1 Sep 2024 14:29:41 EDT (-0400)
  Trace: How to work together with Rotate (Message 1 to 5 of 5)  
From: Sven Littkowski
Subject: Trace: How to work together with Rotate
Date: 11 Nov 2006 03:06:40
Message: <45558490@news.povray.org>
Here a sample of my scene:

#declare Normal=< 0.0, 0.0, 0.0 >;

#declare Angle=30.0;

#while(Angle<360)
 #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
 #declare Boden=trace( Meeresgrund, Location, -y, Normal );
 object {Licht translate < -25.0, Boden.y, 0.0 > rotate < 0.0, Angle, 0.0 
 > }
 declare Angle=Angle+30;
#end

I intent to place some objects (called "Licht") in a circle. Since the 
underground is a height_field, I want to use Trace to get the proper Y 
coordinate of the current location. There I fail. I don't know exactly, how 
to properly define the location for Trace. Please see above. of course, that 
returns an error message. How to do it better?

Thanks,

Sven


Post a reply to this message

From: Thomas de Groot
Subject: Re: Trace: How to work together with Rotate
Date: 11 Nov 2006 03:22:08
Message: <45558830$1@news.povray.org>
"Sven Littkowski" <sve### [at] jamaica-focuscom> schreef in bericht 
news:45558490@news.povray.org...
>
> I intent to place some objects (called "Licht") in a circle. Since the 
> underground is a height_field, I want to use Trace to get the proper Y 
> coordinate of the current location. There I fail. I don't know exactly, 
> how to properly define the location for Trace. Please see above. of 
> course, that returns an error message. How to do it better?
>

I think you should determine first the new location by using: 
vtransform(Vect, Trans)
in transform.inc, and then apply that to the trace().

Thomas


Post a reply to this message

From: Joerg
Subject: Re: Trace: How to work together with Rotate
Date: 11 Nov 2006 03:55:08
Message: <45558fec@news.povray.org>
It should work like this:

----------8<----------8<----------8<----------8<----------8<----------
#declare Normal=< 0.0, 0.0, 0.0 >;

#declare Angle=30.0;

#while(Angle<360)
  #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
  #declare LPos=trace( Meeresgrund, Location, -y, Normal );
  object {Licht translate LPos }
  declare Angle=Angle+30;
#end
----------8<----------8<----------8<----------8<----------8<----------




Sven Littkowski wrote:
> Here a sample of my scene:
> 
> #declare Normal=< 0.0, 0.0, 0.0 >;
> 
> #declare Angle=30.0;
> 
> #while(Angle<360)
>  #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
>  #declare Boden=trace( Meeresgrund, Location, -y, Normal );
>  object {Licht translate < -25.0, Boden.y, 0.0 > rotate < 0.0, Angle, 0.0 
>  > }
>  declare Angle=Angle+30;
> #end
> 
> I intent to place some objects (called "Licht") in a circle. Since the 
> underground is a height_field, I want to use Trace to get the proper Y 
> coordinate of the current location. There I fail. I don't know exactly, how 
> to properly define the location for Trace. Please see above. of course, that 
> returns an error message. How to do it better?
> 
> Thanks,
> 
> Sven 
> 
>


Post a reply to this message

From: Chris B
Subject: Re: Trace: How to work together with Rotate
Date: 11 Nov 2006 04:15:31
Message: <455594b3@news.povray.org>
"Sven Littkowski" <sve### [at] jamaica-focuscom> wrote in message 
news:45558490@news.povray.org...
> Here a sample of my scene:
>
> #declare Normal=< 0.0, 0.0, 0.0 >;
>
> #declare Angle=30.0;
>
> #while(Angle<360)
> #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
> #declare Boden=trace( Meeresgrund, Location, -y, Normal );
> object {Licht translate < -25.0, Boden.y, 0.0 > rotate < 0.0, Angle, 0.0
> > }
> declare Angle=Angle+30;
> #end
>
> I intent to place some objects (called "Licht") in a circle. Since the 
> underground is a height_field, I want to use Trace to get the proper Y 
> coordinate of the current location. There I fail. I don't know exactly, 
> how to properly define the location for Trace. Please see above. of 
> course, that returns an error message. How to do it better?
>
> Thanks,
>
> Sven

Hi Sven,

It looks to me like you want 'Location' to be a point that is 25 units from 
the Y axis and rotates around it.
You can get that by declaring 'Location' using:
#declare Location = vrotate(<-25,100,0>,<0,Angle,0>).

and it's always best (to avoid dissapointment) to test whether you actually 
hit the surface using:
  #if (vlength(Norm)!=0)

By the way, if you start at 30 degrees and stop before you get to 360 
degrees, then, don't you get an incomplete circle of Licht's (whatever a 
Licht is).

As Jorg pointed out, you should be able to place your Licht on your 
Meeresgrund using just:
  object {Licht translate Boden}

Regards
Chris B.


Post a reply to this message

From: Joerg
Subject: Re: Trace: How to work together with Rotate
Date: 11 Nov 2006 04:48:36
Message: <45559c74$1@news.povray.org>
If your Licht object is a light_source you should also add an Y offset to the
position.
Otherwise your light_source is located exacly on the Meeresgrund object, this could
cause some problems.

So here's the new code with an Y offset:

----------8<----------8<----------8<----------8<----------8<----------
#declare Normal=< 0.0, 0.0, 0.0 >;

#declare Angle=30.0;
#declare YOffset = 10;	// The lights are located YOffset
			// units above the Meeresgrund object

#while(Angle<360)
  #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
  #declare LPos=trace( Meeresgrund, Location, -y, Normal );
  object {Licht translate LPos + <0,YOffset,0> }
  declare Angle=Angle+30;
#end
----------8<----------8<----------8<----------8<----------8<----------


Joerg wrote:
> It should work like this:
> 
> ----------8<----------8<----------8<----------8<----------8<----------
> #declare Normal=< 0.0, 0.0, 0.0 >;
> 
> #declare Angle=30.0;
> 
> #while(Angle<360)
>  #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
>  #declare LPos=trace( Meeresgrund, Location, -y, Normal );
>  object {Licht translate LPos }
>  declare Angle=Angle+30;
> #end
> ----------8<----------8<----------8<----------8<----------8<----------
> 
> 
> 
> 
> Sven Littkowski wrote:
> 
>> Here a sample of my scene:
>>
>> #declare Normal=< 0.0, 0.0, 0.0 >;
>>
>> #declare Angle=30.0;
>>
>> #while(Angle<360)
>>  #declare Location=< -25.0, 100.0, 0.0 > rotate < 0.0, Angle, 0.0 >;
>>  #declare Boden=trace( Meeresgrund, Location, -y, Normal );
>>  object {Licht translate < -25.0, Boden.y, 0.0 > rotate < 0.0, Angle, 
>> 0.0  > }
>>  declare Angle=Angle+30;
>> #end
>>
>> I intent to place some objects (called "Licht") in a circle. Since the 
>> underground is a height_field, I want to use Trace to get the proper Y 
>> coordinate of the current location. There I fail. I don't know 
>> exactly, how to properly define the location for Trace. Please see 
>> above. of course, that returns an error message. How to do it better?
>>
>> Thanks,
>>
>> Sven
>>


Post a reply to this message

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