POV-Ray stuff!
View previous topic | View next topic >
Post new topic Reply to topic
M.A.I.L. Forum Index -> Articles Discussion
   
Author Message

Joined: April 07, 2006
Posts: 291
Submissions: 4
Location: Austin, TX

POV-Ray stuff!
Reply with quote
Posted on Wed Jun 07, 2006 9:55 am
Link to Post: Link to Post

I got REALLY into POV-Ray today, and made a few good declares. I WOULD make them includes, but i don't know how.

Silver rings:
#declare silverpigment=
pigment{color rgb<1,1,1>}

#declare silverfinish=
finish{diffuse .2 specular.7 reflection .3 ambient .4 metallic 1}

Gold Rings:
#declare goldpigment=
pigment{color rgb<.85,.7,.3>}

#declare goldfinish=
finish{diffuse .1 specular.8 reflection .2 ambient.5 metallic 1}

Ruby Rings:
#declare rubypigment=
pigment{color rgbt<1.3,0,0,.82>}

#declare rubyfinish=
finish{reflection .4 diffuse .2 specular .3 ambient 1 phong 1}

Sapphire Rings:
#declare sapphirepigment=
pigment{color rgbt<0,0,1,.82>}

#declare sapphirefinish=
finish{reflection .4 diffuse .2 specular .3 ambient 1 phong 1 roughness .1}


I know that took up alot of space... but when i use code i like to see it organized, so that I can change little things here and there, and so when a whole line highlights because I made an error I don't know where to look Very Happy

Anyways, here are the results, the lighting is at <0,10,0>, with <1,1,1> color

(the thing in the middle of the rings... they were supposed to be then names of them, but photobucket resized it Crying (very sad) )

Joined: March 12, 2003
Posts: 3058
Submissions: 74
Location: Tawas City

Reply with quote
Posted on Wed Jun 07, 2006 5:09 pm
Link to Post: Link to Post

Good colors for making tuts. Hold on to those.


maille Code V2.0 T8.3 R6.4 Ep.f Fper Mfe.s Wsg$ Cpw$ G0.25-2.5 I0.5-30 N31.31 Pa Dacdjw Xa27g37w1 S94

Joined: April 07, 2006
Posts: 291
Submissions: 4
Location: Austin, TX

Reply with quote
Posted on Wed Jun 07, 2006 5:14 pm
Link to Post: Link to Post

thx Very Happy
I just realized i need to work on the ruby and sapphire declares, and I made an emerald one. btw, i meant for people to post their own cool mods Very Happy

Joined: October 17, 2004
Posts: 658
Submissions: 1
Location: NewEnglandz

Reply with quote
Posted on Thu Jun 08, 2006 12:03 am
Link to Post: Link to Post

thats REALLY cool. I wish i had more time to mess around with pov-ray.


(BTW, all my guages are awg unless specified.)

Joined: August 25, 2004
Posts: 686
Submissions: 30
Location: Santa Barbara, CA, USA

Reply with quote
Posted on Thu Jun 08, 2006 3:14 am
Link to Post: Link to Post

Those are some nice textures.

I generally use the pigments in the metals.inc file, but they're a bit less distinctive then using bright colors like that. The main include I put together for POV-Ray defines geometry stuff. Specifically, I have:

Ring - Creates a torus based on wire diameter and inner diameter, instead of major and minor radii.

Sided Ring - Creates a ring like above, but with different materials on the top and bottom sides.

Progressive Overlap Row - A row of rings where each ring overlaps the one before it, like a row of European 4-in-1.

Gridlock Overlap Row - A row of rings which alternates rotation, like the connector rows in Gridlock.

Alternating Overlap Row - A row of rings which alternate between being on the top or bottom, like one of the flat rows of Gridlock.

Linked Overlap Row - Basically just a 1-in-1 chain, considered a "row" for weaves like Elfweave.

Spiral Linked Overlap Row - Same thing, but with the rings twisted into a spiral instead of alternating. If fed the appropriate values, this can be used to generate any basic spiral chain.

TrinityMaille - Renders a patch of TrinityMaille, using the Progressive Overlap Rows.

Euro4in1 - Renders a patch of European 4-in-1, using the Progressive Overlap Rows.

Code:

#macro Ring(Wire, ID, Material)
   torus { ID/2 + Wire/2, Wire/2 texture { Material } }
#end

#macro SidedRing(Wire, ID, Material1, Material2)
   #local Width = 2*Wire+ID;
   union {
      difference {
         Ring(Wire, ID, Material1)
         box { <Width, 0, Width>, <-Width, -Width, -Width> texture { Material1 } }
      }
      difference {
         Ring(Wire, ID, Material2)
         box { <Width, 0, Width>, <-Width, Width, -Width> texture { Material2 } }
      }
   }
#end

#macro ProgressiveOverlapRow(Wire, AR, Material, Length, Rotation, Spacing)
   #local RingCount = 0;
   #while (RingCount < Length)
      union {
         Ring(Wire, AR, Material)
         transform {
            rotate z*Rotation
            translate x*RingCount*Spacing
         }
      }
      #local RingCount = RingCount+1;
   #end
#end

#macro GridlockOverlapRow(Wire, AR, Material, Length, Rotation, Spacing)
   #local RingCount = 0;
   #while (RingCount < Length)
      #if (mod(RingCount, 2))
         #local Rot = Rotation;
      #else
         #local Rot = -Rotation;
      #end
      union {
         Ring(Wire, AR, Material)
         transform {
            rotate z*Rot
            translate x*RingCount*Spacing
         }
      }
      #local RingCount = RingCount+1;
   #end
#end

#macro AlternatingOverlapRow(Wire, AR, Material, Length, VertSpacing, HorizSpacing)
   #local RingCount = 0;
   #while (RingCount < Length)
      #if (mod(RingCount, 2))
         #local VertPos = VertSpacing/2;
      #else
         #local VertPos = -VertSpacing/2;
      #end
      union {
         Ring(Wire, AR, Material)
         transform {
            translate x*RingCount*HorizSpacing + y*VertPos
         }
      }
      #local RingCount = RingCount+1;
   #end
#end

#macro LinkedOverlapRow(Wire, AR, Material, Length, Rotation, Spacing)
   #local RingCount = 0;
   #while (RingCount < Length)
      #if (mod(RingCount, 2))
         #local Rot = Rotation;
      #else
         #local Rot = -Rotation;
      #end
      union {
         Ring(Wire, AR, Material)
         transform {
            rotate x*Rot
            translate x*RingCount*Spacing
         }
      }
      #local RingCount = RingCount+1;
   #end
#end

#macro SpiralLinkedOverlapRow(Wire, AR, Material, Length, Rotation, Spacing)
   #local RingCount = 0;
   #local Rot = 0;
   #while (RingCount < Length)
      #local Rot = Rot + Rotation;
      union {
         Ring(Wire, AR, Material)
         transform {
            rotate x*Rot
            translate x*RingCount*Spacing
         }
      }
      #local RingCount = RingCount+1;
   #end
#end

#macro TrinityMaille(Rows, Cols, Material)
   #local RowCount = 0;
   #local RowPos = <0, 0, 0>;
   #while (RowCount < Rows)
      #if (mod(RowCount, 2))
         #local RowPos = RowPos + <5, 0, 6>;
         #local Rot = 30;
      #else
         #local RowPos = RowPos + <0, 0, 6>;
         #local Rot = -30;
      #end
      
      union {
         ProgressiveOverlapRow(1, 5, Material, Cols, Rot, 10)
         translate RowPos
      }
      
      #local RowCount = RowCount+1;
   #end
#end

#macro Euro4in1(Rows, Cols, Material)
   #local RowCount = 0;
   #local RowZ = 0;
   #while (RowCount < Rows)
      #if (mod(RowCount, 2))
         #local RowX = 5;
         #local RowZ = RowZ + 6.5;
         #local Rot = 30;
      #else
         #local RowX = 0;
         #local RowZ = RowZ + 6.5;
         #local Rot = -30;
      #end
      
      union {
         ProgressiveOverlapRow(1, 5, Material, Cols, Rot, 10)
         translate <RowX, 0, RowZ>
      }
      
      #local RowCount = RowCount+1;
   #end
#end



- Mike Powell
<a href="http://spiritofiron.com">Spirit of Iron</a> custom chainmail

Joined: April 07, 2006
Posts: 291
Submissions: 4
Location: Austin, TX

Reply with quote
Posted on Thu Jun 08, 2006 3:41 pm
Link to Post: Link to Post

I haven't gotten into it that much yet..... how do you use include files? I've looked at a couple of them (the glass one specifically) and I want to use it, but I don't know how.

Joined: February 15, 2002
Posts: 397
Submissions: 10

Reply with quote
Posted on Thu Jun 08, 2006 6:23 pm
Link to Post: Link to Post

To include a file, just add the line

#include "filename.ext"

to your file. Once the file is included, then (and only then) you can use any functions, objects, textures, etc. that were listed in the include file. Normally, an include file will have an extension of ".inc". If you keep your include files in the same directory as your scene files, you do not need to do anything special to specify the directory path. I have only one subroutine in my include file
: CreateRing( WD, ID, n, m, d ). This subroutine creates a helical mesh; varying the parameters allows you to create raw rings or rings in varying stages of "openness".

Sample:


The texture used for this image is T_Gold_1E, from golds.inc, which comes with POV-Ray.


IGP (Irregular Grid Painter) Links:
Home | FAQ | Downloads

Joined: August 25, 2004
Posts: 686
Submissions: 30
Location: Santa Barbara, CA, USA

Reply with quote
Posted on Thu Jun 08, 2006 9:21 pm
Link to Post: Link to Post

Wow, that's a pretty cool macro.

But wouldn't it have been simpler to simply use two half-toruses?


- Mike Powell
<a href="http://spiritofiron.com">Spirit of Iron</a> custom chainmail

Joined: February 15, 2002
Posts: 397
Submissions: 10

Reply with quote
Posted on Thu Jun 08, 2006 10:28 pm
Link to Post: Link to Post

Simpler, but not as accurate. Very Happy


IGP (Irregular Grid Painter) Links:
Home | FAQ | Downloads

Joined: August 25, 2004
Posts: 686
Submissions: 30
Location: Santa Barbara, CA, USA

Reply with quote
Posted on Thu Jun 08, 2006 10:46 pm
Link to Post: Link to Post

I don't know how it would be inaccurate at all. When you open a ring, you're just bending it on a single pivot point opposite the break. If you manage to bend it in any other way, on any other point, that would actually deform the ring, not just open it.

Of course, not all of my rings open and close that perfectly, and I DO deform them sometimes... But the idealized open will be precisely represented with two half-toruses.


- Mike Powell
<a href="http://spiritofiron.com">Spirit of Iron</a> custom chainmail

Joined: February 15, 2002
Posts: 397
Submissions: 10

Reply with quote
Posted on Fri Jun 09, 2006 12:42 pm
Link to Post: Link to Post

When you're making your coil, you are creating a helix. The coil is then cut into raw rings, which are just short helices. These are then opened or closed, bending on the pivot point you mentioned. So really, a realistic closed ring would be two half-helices rotated to meet up with each other, not a torus, and a realistic open ring would be two half-helices rotated to open up the gap further, not a true helix as shown in my image.

Of course, if the coil was stretched before cutting, then the open ring would be a true helix.


IGP (Irregular Grid Painter) Links:
Home | FAQ | Downloads

Joined: November 20, 2003
Posts: 2561
Submissions: 77
Location: Northbrook, IL

Reply with quote
Posted on Fri Jun 09, 2006 5:31 pm
Link to Post: Link to Post

was that rendered in pov-ray? if so, how do you have the shadow... I assumed you put a white plane below it. But if that were the case, how is it lit perfectly? No amount of lighting makes any white object totally white, just lighter gray.

Joined: February 15, 2002
Posts: 397
Submissions: 10

Reply with quote
Posted on Fri Jun 09, 2006 6:26 pm
Link to Post: Link to Post

Yes, that was rendered in POV-Ray. Instead of a plane, I have a box, so I can see the edge when I set my camera to look down an axis. As for the lighting, it was a combination of having multiple lights, playing with their respective "brightness" through setting their colors, and creating the right texture for the box.

Here's my scene file: OpenRing.pov


IGP (Irregular Grid Painter) Links:
Home | FAQ | Downloads

Joined: April 07, 2006
Posts: 291
Submissions: 4
Location: Austin, TX

Reply with quote
Posted on Fri Jun 09, 2006 10:05 pm
Link to Post: Link to Post

woah.... i can't believe i actually understood that all! my brother's getting mad at me for talking about POV-Ray stuff, because it makes his brain hurt Very Happy

Joined: November 20, 2003
Posts: 2561
Submissions: 77
Location: Northbrook, IL

Reply with quote
Posted on Tue Jun 13, 2006 1:03 am
Link to Post: Link to Post

I just did some tight Euro 4-1 with an AR of just barely over 3. It's also perfect, with no collisions. I'll provide the code here so you can use it if you like.

camera
{
location <0,5,0>
look_at < 0, 0, 0>
}

background{rgb<1,1,1>}

light_source
{
< 0, 5, 0>
color rgb < 1, 1, 1>
}

#declare ring = torus {.13,.032 texture{T_Gold_1E}}

#declare euro41 = union{object {ring rotate<0,0,31>}
object {ring rotate<0,0,-31> translate<.083,0,-.163>}}

#declare x=-1;
#declare y=-1;
#while (y<1)
#while (x<1)
object {euro41 translate<x,0,y>}
#declare x=x+.166;
#end
#declare y=y+.326;
#declare x=-1;
#end[/i]

Post new topic Reply to topic
Jump to:  
Page 1 of 3. Goto page 1, 2, 3  Next
All times are GMT. The time now is Thu Apr 02, 2020 6:34 am
M.A.I.L. Forum Index -> Articles Discussion
Display posts from previous: