POV-Ray : Newsgroups : povray.newusers : little help Server Time
26 Nov 2024 03:26:44 EST (-0500)
  little help (Message 1 to 3 of 3)  
From: tungy
Subject: little help
Date: 3 Nov 2004 19:00:01
Message: <web.4189705b65c383d67076c2620@news.povray.org>
i'm trying to do something for an assignment and having a little trouble
with grid patterns, how am i suppose to do a grid pattern on a shape.
I also want to know if it is possible to have 2-d letters on the 3d plane
and if that can be done, is it possible to make it have no shadow ?


Post a reply to this message

From: Tom Melly
Subject: Re: little help
Date: 4 Nov 2004 06:51:26
Message: <418a17be$1@news.povray.org>
"tungy" <tun### [at] hotmailcom> wrote in message
news:web.4189705b65c383d67076c2620@news.povray.org...
> i'm trying to do something for an assignment and having a little trouble
> with grid patterns, how am i suppose to do a grid pattern on a shape.

Does the grid need to be mapped to the shape or not? (by which I mean, for
example, if you applied the grid to a sphere, should the lines behave like
longitude and meet at the pole, or should they just divide the sphere up
into slices?)

If the latter, then there are several options, the simplest being to use an
object pattern. e.g.

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}


light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

#declare Grid =
pigment{
 object{
  union{
   #declare N=-5;
   #while(N<5)
    box{<N,-50,-50>,<N+0.01,50,50>}
    box{<-50,N,-50>,<50,N+0.01,50>}
    #declare N = N + 0.1;
   #end
  }
  pigment{Gray50}
  pigment{Blue}
 }
}

sphere {
  0.0, 1
  pigment{Grid}
  translate x*1
}

box{
 0,<1,1,1>
 pigment{Grid}
 translate x*-1
 rotate y*-45
}

However, note that you will have an unwanted effect if a flat surface
intersects with any of the Grid pattern boxes (as in the box example above,
where the left face is solid blue).

> I also want to know if it is possible to have 2-d letters on the 3d plane
> and if that can be done, is it possible to make it have no shadow ?

You mean made 3-d shapes out of a font? Yes, the basic text (see 'text
tutorial' in the docs) syntax has a Thickness parameter. If you want 2-d
character, you can just set Thickness to a very small value (I was going to
suggest making an intersection between a plane and a text object, but I
don't think that would work, since, iirc, a plane is solid in the
negative-normal direction).

For no shadows, check no_shadow in the docs...


Post a reply to this message

From: tungy
Subject: Re: little help
Date: 10 Nov 2004 14:45:00
Message: <web.41926f21d2e1d5cb7076c2620@news.povray.org>
thanks for your help, it was really useful


Post a reply to this message

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