POV-Ray : Newsgroups : povray.newusers : this is very strange!! Server Time
25 Dec 2024 01:48:58 EST (-0500)
  this is very strange!! (Message 1 to 4 of 4)  
From: Lenx
Subject: this is very strange!!
Date: 11 Dec 2002 17:30:04
Message: <web.3df7bbc0306b460ede2a6cfb0@news.povray.org>
#include "Colors.inc"

camera{
   location <0,10,0>
   look_at <0,2,0>
   }

light_source{ <-10,10,-10> color White}

plane{ y,0 pigment{ checker Black White } }




box{ <0,0,0> <.1,6,.1> rotate <30,0,-30> translate <-2,0,-2> pigment{Grey}}

box{ <-.05,0,-.05> <.05,6,.05> pigment{Green} finish{ambient .3} }



When you render this scene, you see a grey rod next to a green one. I don't
understand why they don't intersect?! Looking to the rotation of the grey
rod, it should be crossing a point where x=0 and z=0 (the green rod).
But it doesn't...
I thought a lot about this but i realy don't understand.
can someone please explain what's wrong here?


Post a reply to this message

From: Fidel viegas
Subject: Re: this is very strange!!
Date: 11 Dec 2002 20:48:19
Message: <BA1D9A05.7FD8%fidel.viegas@artrecognition.co.uk>
in article web.3df7bbc0306b460ede2a6cfb0@news.povray.org, Lenx at
lenx_@hotmail.com wrote on 11/12/02 10:27 pm:

> #include "Colors.inc"
> 
> camera{
> location <0,10,0>
> look_at <0,2,0>
> }
> 
> light_source{ <-10,10,-10> color White}
> 
> plane{ y,0 pigment{ checker Black White } }
> 
> 
> 
> 
> box{ <0,0,0> <.1,6,.1> rotate <30,0,-30> translate <-2,0,-2> pigment{Grey}}
> 
> box{ <-.05,0,-.05> <.05,6,.05> pigment{Green} finish{ambient .3} }
> 
> 
> 
> When you render this scene, you see a grey rod next to a green one. I don't
> understand why they don't intersect?! Looking to the rotation of the grey
> rod, it should be crossing a point where x=0 and z=0 (the green rod).
> But it doesn't...
> I thought a lot about this but i realy don't understand.
> can someone please explain what's wrong here?
> 
> 

For you to have an intersection, you need to use the CSG. In your case, you
need to wrap your two boxes above with the keyword intersection as follows:

intersection {
  box{ 
    <0,0,0>, 
    <.1,6,.1> 
    rotate <30,0,-30>
    translate <-2,0,-2>
    pigment{Grey}
  }
  box{ 
    <-.05,0,-.05>, 
    <.05,6,.05> 
    pigment{Green} 
    finish{ambient .3}
  }
}

But the two boxes above do not have an intersection point. So, in this case
it is useless. What exactly are you trying to create? Have a look at your
code again and fiddle with it so that you have an intersection area that
matches your requirements.
Also, have a look at the documentation on section 3.3 for general CSG and
section 3.3.3 for intersection. That should help you out.

All the best

Fidel.


Post a reply to this message

From: Warp
Subject: Re: this is very strange!!
Date: 12 Dec 2002 05:47:05
Message: <3df86929@news.povray.org>
Lenx <lenx_@hotmail.com> wrote:
> box{ <0,0,0> <.1,6,.1> rotate <30,0,-30> translate <-2,0,-2> pigment{Grey}}

> When you render this scene, you see a grey rod next to a green one. I don't
> understand why they don't intersect?! Looking to the rotation of the grey
> rod, it should be crossing a point where x=0 and z=0 (the green rod).
> But it doesn't...

  You are assuming that after rotating 30 degrees around the x-axis and
then -30 degrees around the z-axis, the rod will be 45 degrees from both
axes (only that way it would cross the y axis when translated to <-2,0,-2>).
  This isn't so.

  If you want the rod to cross the y-axis, you need to truely rotate it
45 degrees around the y-axis. That is:

box{ <0,0,0> <.1,6,.1> rotate <30,45,0> translate <-2,0,-2> pigment{Grey}}

-- 
#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: Fidel viegas
Subject: Re: this is very strange!!
Date: 12 Dec 2002 09:13:31
Message: <BA1E48AF.803C%fidel.viegas@artrecognition.co.uk>
in article 3df86929@news.povray.org, Warp at war### [at] tagpovrayorg wrote on
12/12/02 10:47 am:

> Lenx <lenx_@hotmail.com> wrote:
>> box{ <0,0,0> <.1,6,.1> rotate <30,0,-30> translate <-2,0,-2> pigment{Grey}}
> 
>> When you render this scene, you see a grey rod next to a green one. I don't
>> understand why they don't intersect?! Looking to the rotation of the grey
>> rod, it should be crossing a point where x=0 and z=0 (the green rod).
>> But it doesn't...
> 
> You are assuming that after rotating 30 degrees around the x-axis and
> then -30 degrees around the z-axis, the rod will be 45 degrees from both
> axes (only that way it would cross the y axis when translated to <-2,0,-2>).
> This isn't so.
> 
> If you want the rod to cross the y-axis, you need to truely rotate it
> 45 degrees around the y-axis. That is:
> 
> box{ <0,0,0> <.1,6,.1> rotate <30,45,0> translate <-2,0,-2> pigment{Grey}}

I guess I misread the question. Sorry, I thought he was looking for CSG
stuff.

Thanks for clearing that out Warp.

All the best

Fidel.


Post a reply to this message

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