POV-Ray : Newsgroups : povray.binaries.images : Suggestions needed Server Time
31 Jul 2024 08:30:56 EDT (-0400)
  Suggestions needed (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Suggestions needed
Date: 27 Apr 2010 17:20:01
Message: <web.4bd754795bb1be65ae92d9930@news.povray.org>
"Dave Blandston" <nomail@nomail> wrote:
> And, unioning in a plain sphere scaled just right
> could cover up those extra indentations handily. Thanks so much for your help!

Duh! I didn't think of that. Thank YOU!

Ken


Post a reply to this message

From: Alain
Subject: Re: Suggestions needed
Date: 27 Apr 2010 20:51:46
Message: <4bd786a2$1@news.povray.org>

> "Dave Blandston"<nomail@nomail>  wrote:
>
>> Currently I'm working on a CSG model of an Mk 2 hand grenade. So far the top
>> part is finished except for the spoon. I'm having a hard time figuring out how
>> to construct the actual body of the grenade, though. Does anybody have any
>> suggestions?
>
> Would a triangle-mesh object made with POV's HF_Sphere macro qualify as 'SDL'?
>
> Here's a basic idea, some code I came up with (and an image.) It's one way to do
> it; there are probably others. Just add a camera and some lights. The code's not
> perfect by any means, but it does create that 'pineapple' look. BTW, I could
> have used 'pattern' rather than 'pigment' to generate the functions (to do away
> with the .gray step)--but the two functions need to be combined anyway, before
> being used in the macro. (It accepts only one.)
>

You can use .x .y .z .red .green or .blue without any problem in this 
case. You can do that because your pigment is black and white.
Using a single channel is faster, you only fetch that channel instread 
of geting all 3 channels and doing a ponderated average.


Alain


Post a reply to this message

From: Kenneth
Subject: Re: Suggestions needed
Date: 28 Apr 2010 03:50:00
Message: <web.4bd7e8295bb1be65ae92d9930@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> You can use .x .y .z .red .green or .blue without any problem in this
> case. You can do that because your pigment is black and white.
> Using a single channel is faster, you only fetch that channel instread
> of geting all 3 channels and doing a ponderated average.
>

You're right. I keep forgetting that alternative. (You had mentioned it before
in another post.) The gradient x/y/z pigments are indeed grayscale (or at least
the *same* colors across all three channels.)

Ken


Post a reply to this message

From: Kenneth
Subject: Re: Suggestions needed
Date: 28 Apr 2010 04:10:01
Message: <web.4bd7ecf55bb1be65ae92d9930@news.povray.org>
"Dave Blandston" <nomail@nomail> wrote:

> Currently I'm working on a CSG model of an Mk 2 hand grenade.

I just came up with another idea. Seems like a far simpler one, using just CSG.
(No code this time, just the general idea.)

1) An elongated sphere.
2) The vertical and horizontal indents are initially torri with small minor
radii (and stretched to match the shape of the elongated sphere); multiple
copies are then differenced from the sphere. This should give it the overall
'pineapple' look, with rounded grooves.
3) A 'fatter' torus is then differenced, to cut away the top curve of the
grenade.

The only drawback I see is that the pineapple chunks will have sharp edges all
around their outside surfaces. Not good. The soldier would have to handle the
grenade with gloves!

Ken


Post a reply to this message

From: Kenneth
Subject: Re: Suggestions needed
Date: 28 Apr 2010 04:30:01
Message: <web.4bd7f1115bb1be65ae92d9930@news.povray.org>
"Dave Blandston" <nomail@nomail> wrote:

> ...Here's a photo of a grenade similar to the one I'm modelling:

The closer I look at this photo, the more details I see. I was wrong about a
torus being used to difference away the top part of the grenade; it has a
cone-like shape instead. (So differencing an inverse cone might work.)

In fact, even the indents don't look like they have rounded bottoms; more like
45-deg. sharp cornered wedge-shaped crevices. The entire grenade looks to have
been *cast* from iron, rather than machined into shape. Probably using a sand
mold, which would round off all the sharp corners.

Hmm, not as simple as I thought.  Seems to me that some fancy isosurface coding
may be required (and to get the overall sandy/bumpy look.)

Ken


Post a reply to this message

From: Dave Blandston
Subject: Re: Suggestions needed
Date: 28 Apr 2010 05:35:00
Message: <web.4bd800a15bb1be65cba3fb0f0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> The only drawback I see is that the pineapple chunks will have sharp edges all
> around their outside surfaces. Not good. The soldier would have to handle the
> grenade with gloves!
>
> Ken

This one design problem is what's driving me nuts. If it weren't for all those
rounded edges this would so much simpler.

The body of the grenade is in fact cast iron. I bought an inert grenade to make
measurements from and the top part is a cone. The bumps on each row aren't all
the same width and don't all have the same slope on the sides, but for
simplicity I'm not trying to duplicate those anomalies.

Your pigment idea may still work. I made a height field with rounded-edged bumps
recently (for the same scene the grenade is intended for, in fact). The method I
used was to make a color_map with several entries, going from black to white in
steps determined by the function

#local CurrentColorEntry = color White * pow (sin (radians (Theta)), .5);

where Theta goes from 0 to 90 then from 90 back to 0. Obviously, this is not the
easiest or best way to make such a simple shape, but it was a learning exercise.
The attached image shows the result. I think this method can be combined with
your code to produce the rounded grenade bumps.

Another alternative is to use the M26 grenade for my scene. It uses the same
fuse I've already modelled. The body is extremely simple. I'm not ready to give
up yet on the Mk2 grenade though, because it's much more interesting looking
than the M26.

I've never made an isosurface and really need to learn to use them. This may be
a tough project for a first attempt though...

Thanks again!

Regards,
Dave Blandston


Post a reply to this message


Attachments:
Download 'roundhf.jpg' (9 KB)

Preview of image 'roundhf.jpg'
roundhf.jpg


 

From: Kenneth
Subject: Re: Suggestions needed
Date: 28 Apr 2010 08:30:01
Message: <web.4bd8291c5bb1be65ae92d9930@news.povray.org>
"Dave Blandston" <nomail@nomail> wrote:
> I made a height field with rounded-edged bumps recently (for the same scene the
> grenade is intended for, in fact). The method I used was to make a color_map
> with several entries, going from black to white insteps determined by the
> function
>
> #local CurrentColorEntry = color White * pow (sin (radians (Theta)), .5);
>
> where Theta goes from 0 to 90 then from 90 back to 0.

That's a nicely interesting idea; I get the gist of it. Worth experimenting with
at my end.  Thanks!

Ken


Post a reply to this message

From: Dave Blandston
Subject: Re: Suggestions needed
Date: 28 Apr 2010 08:55:00
Message: <web.4bd82f705bb1be65cba3fb0f0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> That's a nicely interesting idea; I get the gist of it. Worth experimenting with
> at my end.  Thanks!
>
> Ken

Here's all the code, in case you're interested...

   #local ThreadWidth = .18;
   #local EdgeWidth = .16;
   #local HorizontalScale = 1/1; //MUST be 1/N, to make the HF tileable.
   #local RowOffset = 1/3;
   #local DeltaTheta = 1; //MUST be a factor of 90.
   #local HFResolution = 512;

   #local D = EdgeWidth / HorizontalScale;

   #local NPigments = 90 / DeltaTheta + 1;

   #local BallisticNylonPigment = array [NPigments]

   #local Theta1 = 0;
   #local I = 0;
   #while (I < NPigments)
      #local CurWhite = color White * pow (sin (radians (Theta1)), .5);
      #local BallisticNylonPigment [I] = pigment {
         gradient x
         color_map {
            #local Theta2 = 0;
            #while (Theta2 <= 90)
               #local CurPos = D * (Theta2 / 90); //0 .. D
               [CurPos color CurWhite * pow (sin (radians (Theta2)), .5)]
               #local Theta2 = Theta2 + DeltaTheta;
            #end //#while
            #local Theta2 = 90;
            #while (Theta2 >= 0)
               #local CurPos = 1 - D * (Theta2 / 90); //D .. 0
               [CurPos color CurWhite * pow (sin (radians (Theta2)), .5)]
               #local Theta2 = Theta2 - DeltaTheta;
            #end //#while
         } //color_map
         scale <HorizontalScale, 1, 1>
      } //pigment
      #local Theta1 = Theta1 + DeltaTheta;
      #local I = I + 1;
   #end //#while

   #local BallisticNylon = pigment {
      gradient y
      pigment_map {
         #local P1 = .5 - ThreadWidth / 2 - EdgeWidth;
         #local P2 = .5 - ThreadWidth / 2;
         #local D = P2 - P1;
         [0 color Black]
         #local I = 0;
         #while (I < NPigments)
            [P1 + D * (I / NPigments) BallisticNylonPigment [I]]
            #local I = I + 1;
         #end //#while
         #local P1 = .5 + ThreadWidth / 2;
         #local P2 = .5 + ThreadWidth / 2 + EdgeWidth;
         #local D = P2 - P1;
         #local I = 0;
         #while (I < NPigments)
            [P1 + D * (I / NPigments) BallisticNylonPigment [NPigments - I - 1]]
            #local I = I + 1;
         #end //#while
         [1 color Black]
      } //pigment_map
   } //pigment

   #local BallisticNylon = pigment {
      average
      pigment_map {
         [1 BallisticNylon]
         [1 BallisticNylon translate <RowOffset * HorizontalScale, .5, 0>]
      } //pigment_map
      scale BallisticNylonScale
   } //pigment

   #local BallisticNylon = height_field {
      function HFResolution, HFResolution {pigment {BallisticNylon}}
      smooth
      rotate -90 * x
      scale <1, 1, .08>
   } //height_field


Post a reply to this message

From: Thomas de Groot
Subject: Re: Suggestions needed
Date: 30 Apr 2010 04:49:41
Message: <4bda99a5$1@news.povray.org>
"Christian Froeschlin" <chr### [at] chrfrde> schreef in bericht 
news:4bd5ef2b$1@news.povray.org...
>
> It's going to end up as a perfume bottle anyway so
> why bother with the martial intermediate step? :-P

LOL! You made my day, my friend!

Thomas


Post a reply to this message

From: Dave Blandston
Subject: Re: Suggestions needed
Date: 10 May 2010 19:45:00
Message: <web.4be899a85bb1be65cba3fb0f0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> There's still a problem with the model that I haven't yet been able to solve:
> Where the vertical and horizontal indent lines meet, there's a deeper indent at
> each intersection.

Ok, I've been tinkering with this and here's what I came up with - I figured
Kenneth would be interested. Instead of adding the vertical and horizontal
functions to get the final function, multiply them (without multiplying each by
..5), thusly:

#local PigmentFunction_Final = function {
   PigmentFunction_Vertical (x, y, z).red *
   PigmentFunction_Horizontal (x, y, z).red
} //function

That solves the problem!

Regards,
Dave Blandston


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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