Closed Thread Icon

Topic awaiting preservation: new to pov-ray Pages that link to <a href="https://ozoneasylum.com/backlink?for=11590" title="Pages that link to Topic awaiting preservation: new to pov-ray" rel="nofollow" >Topic awaiting preservation: new to pov-ray\

 
Author Thread
evilclown01
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

posted posted 12-29-2001 03:06

here's my first real attempt in pov-ray. What do you think?



What can I do to make it better?

Am I doing any bad coding habits? Is there an easier way to copy all the towers and walls, or do i have to make the object lines?

code:
//castle
//2001

#include "colors.inc"
#declare cdist = 10;

#declare roof = texture {
pigment {
hexagon
color Red
color Red*0.6
color Red*0.3
scale 0.1
}
}

#declare rock = texture {
pigment {
granite
color_map {
[0.0 color Black]
[0.8 color Gray85]
[1.0 color Gray70]
}
}
}

#declare ctower = union {
cylinder {
<0, 0, 0>, <0, 10, 0>, 1
texture {
rock
}
}
cone {
<0, 10, 0>, 1.5, <0, 15, 0>, 0
texture {
roof
}
}
}

#declare cwall =
box {
<-cdist, 0, -0.5>, <cdist, 6, 0.5>
texture {
rock
}
}

#declare cfloor = box {
<-10, 0, -10>, <10, 0.001, 10>
texture {
rock
}
}

//camera
camera {
//location <0, 10, -20> //close front
//location <0, 20, -20> //front
//location <0.1, 50, 0.1> //sky
location <0, 30, -30> //rendering
look_at <0, 0, 0>
}

//light
light_source {
//<0, 20, -20>
<5, 30, -15>
color rgb <1, 1, 1>
}

//ground
plane {
y, 0
pigment { color Green }
}

object {
cfloor
}

object {
cwall
translate <0, 0, cdist>
}

object {
cwall
translate <0, 0, -cdist>
}

object {
cwall
rotate <0, 90, 0>
translate <cdist, 0, 0>
}

object {
cwall
rotate <0, 90, 0>
translate <-cdist, 0, 0>
}

object {
ctower
translate <-cdist, 0, -cdist>
}

object {
ctower
translate <-cdist, 0, cdist>
}

object {
ctower
translate <cdist, 0, -cdist>
}

object {
ctower
translate <cdist, 0, cdist>
}



How do you use textures? I tried using the one in the same directory as the pov file, but it turned out all black.

evilclown01

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-29-2001 03:41

Hello and welcome.

Pretty good, and the code is well written. As far as bad coding practice, I don't see anything bad at all, it was good to pre-declare the objects instead of typing the same code over and over. You might have done the four walls and floor more simply by doing a difference between two boxes (look up "CSG" or "difference" in the help files). If you had more repeated objects, you might have used a while loop, but you don't have so many that you need to worry about that.

You might want to try the "crackle" pattern (as opposed to "granite"), maybe with some turbulence, to do the stone walls. And if I were you, I'd move the light source farther away.

When you say "how do you use textures" I assume you mean "image maps". There can be a lot of things that can go wrong, but if you didn't get any errors (such as "file cannot be found") then it probably means you need to translate, rotate, or otherwise move the texture around so it fits the place you want it to. Look up "image map" in the help files.

evilclown01
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

posted posted 12-29-2001 04:23

what vector would you suggest for the light? I couldn't get it to look right.

Here's how I tried to texture

code:
//ground
plane {
y, 0
texture {
material_map {
tga "grass.tga"
texture {
}
}
}
}


If i don't put texture {} there, it says expected texture. Should I be putting something in there? Do i have to do something else? (i have a little green square as the texture that should be tiled)

evilclown01

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 12-29-2001 05:45

Oh, you're using a material_map. That's not quite what you want. Here's what you want to do:

texture {
pigment{
image_map {
tga "grass.tga"
}
}
}

(sorry 'bout the lack of tabs)

That will map the image to the pigment. Pigment is basically the color. There are other parts of the texture, such as finish and normal, that control things other than the color (like highlights and reflections).

The reason it expects a texture in your material_map is that what material_maps actually do are change the texture according to the color of the image. I believe it works like this:

texture {
material_map {
tga "mymap.tga"
[0 pigment{...} finish{...} normal{...}]
[1 pigment{...} finish{...} normal{...}]
}
}

It works like a color_map. The color of the image can be thought of a greyscale value from zero to one, and it takes that value and interpolates between the two (or more) textures specified. It's sorta complicated. I'm not sure if you've been introduced to that concept yet.

Try changing your light's position from <5, 30, -15> to <5, 30, -15>*100 or so. Just multiplying the vector makes it go that many times away from the origin. (So that's basically the same as <500, 3000, -1500> )

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-29-2001 12:16

weeee...
another povray addicted!
welcome!

you could add another light source to your scene to get rid of the dark areas. or is it just my dark monitor?

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 12-29-2001 21:40

you PVR crackheads.... 3dsmax is the way do go!!!

(bet you never thought you'd see a IEv.NN-style war here...hehehe)


"...when I'm high like heaven, when I'm strong like music, 'cause I'm slow like honey and heavy with mood..."
ICQ: 67751342

Relain
Paranoid (IV) Inmate

From: westernesse
Insane since: Jul 2000

posted posted 12-29-2001 21:53

yeah max is better, but you gotta buy it. Blender has to be the best free 3d prog or Terragen. Im hooked on terragen, can spend ages just twiddling until it looks nice.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-30-2001 12:13

max is a Pro-Tool. and you gotta buy it, right!

i tried blender once, but i dont like the user interface.
another free tool is g-max. it's the free version of 3dsmax especially for creating maps for 3d-shooters etc.

POV-Ray is a cult. i love it. it is more "compact" than max. you have full control over all elements of the scene, because you type it yourself.

Relain
Paranoid (IV) Inmate

From: westernesse
Insane since: Jul 2000

posted posted 12-30-2001 22:59

yeah i agree, pov-ray is very good. Especially so if you're a coder at heart or you want to set everything up just so. but i couldn't cope with it i wanted to just play and make things. Moray was quite good fun though its a kinda basic modeller but it let me pick up the basics of Ik and stuff. So a big plus there.
Its good how blender totally screwed me in terms of using any other 3d program, you get hooked on its kinda whacky interface. I'm dubious as to the virtues of gmax, my understanding is that you can only make bits for specific games, you can't make your own games or anything. Although anything free from discreet is fairly miraculous.

evilclown01
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

posted posted 01-01-2002 06:49

Do you have links to Terragen and Moray. Is Moray free?

I didn't texture the wood yet, and I couldn't get the moat right. Any ideas how to fix the moat?


Here's a keep i'm working on. It's a keep so it won't be "hollow" like the first one. It'll have walls surrounding it soon.



Slime: i tried crackle but it still doesn't look right. Would i be better off making my own texture and then maybe making a (i think it's called) texture_map. (it is layers of textures).

How do you make a sky? I think you can set a sky color but is it better to make a sky sphere or something?



evilclown01

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 01-01-2002 22:17

Don't bother with a texture_map yet. Have you gone through the tutorial in the help file yet? that might help you make some textures. Try fiddling with turbulence in the pigment and a normal in the texture.

The moat could be done more easily if you made a height_map (which could also make more realistic terrain) and then put a plane or some other object with a planar surface partially underneath the height map, so that parts of it appeared where the height map was lower, creating the moat.

As for the sky, you can either use background{rgb <red,green,blue>} or sky_sphere{pigment{...}}. If you want clouds, it usually looks best to put a plane way up high with a partially transparent pigment (bozo or granite tends to work well in my experience, if you use turbulence).

By the way, scale your grass pigment a bit larger, it's pretty obvious that it's a repeating pattern as it is now.

Just play around with things. You'll figure stuff out. =)

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 01-09-2002 10:59

did anyone of you ever try www.pov-lab.org it's another modeller and it's free!
i'll have a look at it and be back with results!

« BackwardsOnwards »

Show Forum Drop Down Menu