POV-Ray : Newsgroups : povray.newusers : How can I do an arrow? Server Time
30 Jul 2024 10:12:40 EDT (-0400)
  How can I do an arrow? (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Oleguer Vilella
Subject: How can I do an arrow?
Date: 5 Aug 2004 15:19:26
Message: <4112883e@news.povray.org>


Thank you very much,
Oleguer


Post a reply to this message

From: Florian Brucker
Subject: Re: How can I do an arrow?
Date: 5 Aug 2004 16:39:24
Message: <41129afc$1@news.povray.org>


It would really help if you would give some more information about what 
you're trying to achieve. Do you want an arrow as a 3D-object, 
2D-object, on a texture, how should it look, etc.

Now I can only guess, so here's one (propably the simplest) way to 
create a 3D arrow:

union {
	cylinder { <-5,0,0>,<0,0,0>,1 }
	cone { <0,0,0>,2,<3,0,0>,0 }
	pigment { rgb<1,0,0> }
}


HTH,
Florian


Post a reply to this message

From: Hughes, B 
Subject: Re: How can I do an arrow?
Date: 5 Aug 2004 16:47:51
Message: <41129cf7$1@news.povray.org>
"Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
news:4112883e@news.povray.org...


Hi Oleguer. Well, it's simple really. :) Or can be, anyway, if you only want
a simple arrow. For example:

union {
    cone {0,1,y,0}
    cylinder {-y,0,0.5}
    pigment {rgb 1}
    scale <1,2,1> // size change, longer
    rotate <0,0,90> // point in another direction (left)
}

Hint: you might want the point tip to be at <0,0,0> so when moving it around
it will be easier to place pointing exactly to a particular spot. Or... with
the other end at <0,0,0>. Either way can be accomplished by adding a
translate -y or +y before scale.

So, there's one way to do it.

Bob H.


Post a reply to this message

From: Hughes, B 
Subject: Re: How can I do an arrow?
Date: 5 Aug 2004 16:51:31
Message: <41129dd3$1@news.povray.org>
"Florian Brucker" <tor### [at] torfboldcom> wrote in message
news:41129afc$1@news.povray.org...
>

>
> It would really help if you would give some more information about what
> you're trying to achieve. Do you want an arrow as a 3D-object,
> 2D-object, on a texture, how should it look, etc.

Good point (no pun intended, but take it anyhow. haha!), since an arrow
could also be done using a font in the text object, too. Many ways of going
about it. I chose to explain a simple CSG way, like you did.

> Now I can only guess, so here's one (propably the simplest) way to
> create a 3D arrow:
>
> union {
> cylinder { <-5,0,0>,<0,0,0>,1 }
> cone { <0,0,0>,2,<3,0,0>,0 }
> pigment { rgb<1,0,0> }
> }


Post a reply to this message

From: Oleguer Vilella
Subject: Re: How can I do an arrow?
Date: 6 Aug 2004 02:31:19
Message: <411325b7@news.povray.org>
Yeah, that's it Florian and Hughes, that's the object that I need it. Now I
know how can I do it and I'll do my own arrow. Thank you very much for your
help. Have a nice day.

Best regards,
Oleguer



news:41129cf7$1@news.povray.org...
> "Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
> news:4112883e@news.povray.org...

>
> Hi Oleguer. Well, it's simple really. :) Or can be, anyway, if you only
want
> a simple arrow. For example:
>
> union {
>     cone {0,1,y,0}
>     cylinder {-y,0,0.5}
>     pigment {rgb 1}
>     scale <1,2,1> // size change, longer
>     rotate <0,0,90> // point in another direction (left)
> }
>
> Hint: you might want the point tip to be at <0,0,0> so when moving it
around
> it will be easier to place pointing exactly to a particular spot. Or...
with
> the other end at <0,0,0>. Either way can be accomplished by adding a
> translate -y or +y before scale.
>
> So, there's one way to do it.
>
> Bob H.
>
>


Post a reply to this message

From: Hughes, B 
Subject: Re: How can I do an arrow?
Date: 6 Aug 2004 04:23:54
Message: <4113401a$1@news.povray.org>
"Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
news:411325b7@news.povray.org...
> Yeah, that's it Florian and Hughes, that's the object that I need it. Now
I
> know how can I do it and I'll do my own arrow.

Happy to have helped.

Bob H.


Post a reply to this message

From: Oleguer Vilella
Subject: Re: How can I do an arrow?
Date: 6 Aug 2004 09:04:26
Message: <411381da@news.povray.org>
Hello,

The code is
#include "colors.inc"
#include "textures.inc"
  background { White
  }
  camera {location <170, -11, -100>look_at  <180, -15, -16>}
  light_source { <170, -30, -100> color White}

union {
cone { <0,0,0>,2,<3,0,0>,0  }
cylinder  { <-5,0,0>,<0,0,0>,1 }
pigment { rgb<0,1.1,0> }
scale <0.9, 1.6, 1>
translate <120, 40, 26>
rotate <-0, 0, -26>
no_shadow
}
To the arrow. I have trayed to rotate it to an other direction. I want to
put the cone looking on the other side of the screen, but I couldn't. When I
modified the "rotate" vector, all the arrow desapear. What's the problem??

Thank you very much,
Oleguer




news:4112883e@news.povray.org...

>
> Thank you very much,
> Oleguer
>
>


Post a reply to this message

From: Hughes, B 
Subject: Re: How can I do an arrow?
Date: 6 Aug 2004 09:40:56
Message: <41138a68@news.povray.org>
"Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
news:411381da@news.povray.org...
> union {
> cone { <0,0,0>,2,<3,0,0>,0  }
> cylinder  { <-5,0,0>,<0,0,0>,1 }
> pigment { rgb<0,1.1,0> }
> scale <0.9, 1.6, 1>
> translate <120, 40, 26>
> rotate <-0, 0, -26>
> no_shadow
> }
> To the arrow. I have trayed to rotate it to an other direction. I want to
> put the cone looking on the other side of the screen, but I couldn't. When
I
> modified the "rotate" vector, all the arrow desapear. What's the problem??

Hi again, Oleguer.

Probably because of the translate before rotate, which will tend to move it
a lot more than just turning it around.

You need to watch the order of transformations you use. And also, I think
you might not be thinking of degrees of rotate, i.e. 180 = half circle, and
instead units (your translate 26 then rotate -26) but I'd only be guessing
what you're really trying. So maybe you do realize rotate is in degrees by
default and that is coincidental numbers. Anyway...

That aside, when building an object, try to keep it at or near the origin
(<0,0,0>) and scale it first, secondly do rotate (or rotate first then
scale, depending on the situation), lastly translate. That way you are able
to turn the objects based on the origin and move around from there. Helps to
keep it in one place until the final move. Of course, the better you get at
it the easier it is to know how to use other locations and move things
around. But for simplicities sake, this scale>rotate>translate method works
well as long as your object is created at <0,0,0> for some part of it.

For example:

union {
cone { <0,0,0>,2,<3,0,0>,0  }
cylinder  { <-5,0,0>,<0,0,0>,1 }
pigment { rgb<0,1.1,0> }
scale <0.9, 1.6, 1>
rotate 180*y // face left
translate <220, -15, -16> // to right of look_at point
no_shadow
}

Not sure if this is anything like you wanted to do but it's on the other
side now and pointing toward the middle. You'll catch on to the idea if you
order your transformations correctly. In fact, you might discover that
rotate itself has order, so if you must turn it around the y axis and then x
you need to use two rotates, since a single one can't be reordered from
x,y,z. E.g. rotate <0,180,0> rotate <180,0,0>.

Bob H.


Post a reply to this message

From: Oleguer Vilella
Subject: Re: How can I do an arrow?
Date: 6 Aug 2004 11:56:06
Message: <4113aa16@news.povray.org>
I put your code with my camera, and I couldn't see it. My camera is
#include "colors.inc"
#include "textures.inc"
background { White}
camera { location <0, 1, -100> look_at <1, 1, 1> }
light_source { <170, -30, -100> color White}

I've copied your code and your arrow just desepear. Thank you very much for
the information about the order of the words, I didn't know it, I'll do it
like you. Do you think that's camera problem??




news:41138a68@news.povray.org...
> "Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
> news:411381da@news.povray.org...
> > union {
> > cone { <0,0,0>,2,<3,0,0>,0  }
> > cylinder  { <-5,0,0>,<0,0,0>,1 }
> > pigment { rgb<0,1.1,0> }
> > scale <0.9, 1.6, 1>
> > translate <120, 40, 26>
> > rotate <-0, 0, -26>
> > no_shadow
> > }
> > To the arrow. I have trayed to rotate it to an other direction. I want
to
> > put the cone looking on the other side of the screen, but I couldn't.
When
> I
> > modified the "rotate" vector, all the arrow desapear. What's the
problem??
>
> Hi again, Oleguer.
>
> Probably because of the translate before rotate, which will tend to move
it
> a lot more than just turning it around.
>
> You need to watch the order of transformations you use. And also, I think
> you might not be thinking of degrees of rotate, i.e. 180 = half circle,
and
> instead units (your translate 26 then rotate -26) but I'd only be guessing
> what you're really trying. So maybe you do realize rotate is in degrees by
> default and that is coincidental numbers. Anyway...
>
> That aside, when building an object, try to keep it at or near the origin
> (<0,0,0>) and scale it first, secondly do rotate (or rotate first then
> scale, depending on the situation), lastly translate. That way you are
able
> to turn the objects based on the origin and move around from there. Helps
to
> keep it in one place until the final move. Of course, the better you get
at
> it the easier it is to know how to use other locations and move things
> around. But for simplicities sake, this scale>rotate>translate method
works
> well as long as your object is created at <0,0,0> for some part of it.
>
> For example:
>
> union {
> cone { <0,0,0>,2,<3,0,0>,0  }
> cylinder  { <-5,0,0>,<0,0,0>,1 }
> pigment { rgb<0,1.1,0> }
> scale <0.9, 1.6, 1>
> rotate 180*y // face left
> translate <220, -15, -16> // to right of look_at point
> no_shadow
> }
>
> Not sure if this is anything like you wanted to do but it's on the other
> side now and pointing toward the middle. You'll catch on to the idea if
you
> order your transformations correctly. In fact, you might discover that
> rotate itself has order, so if you must turn it around the y axis and then
x
> you need to use two rotates, since a single one can't be reordered from
> x,y,z. E.g. rotate <0,180,0> rotate <180,0,0>.
>
> Bob H.
>
>


Post a reply to this message

From: Hughes, B 
Subject: Re: How can I do an arrow?
Date: 6 Aug 2004 12:07:04
Message: <4113aca8$1@news.povray.org>
"Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
news:4113aa16@news.povray.org...
> I put your code with my camera, and I couldn't see it. My camera is
> #include "colors.inc"
> #include "textures.inc"
> background { White}
> camera { location <0, 1, -100> look_at <1, 1, 1> }
> light_source { <170, -30, -100> color White}
>
> I've copied your code and your arrow just desepear. Thank you very much
for
> the information about the order of the words, I didn't know it, I'll do it
> like you. Do you think that's camera problem??

Yes. In your other message you had used:

  camera {location <170, -11, -100>look_at  <180, -15, -16>}

The camera location and look_at point is way off now, by 170 to 180, so if
you change the arrows translate to <0,0,0> you'll see it centered again.

Bob H.


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

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