|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Since no objection from Mr. Bourke (or anyone else) has been forthcoming, I
shall proceed with my declared intention of opening a thread for tips on
know more about such things (that would be most of the people reading this)
will add their knowledge to the pool. Thus begins:
--------------------------------------------------------------
THE UNOFFICIAL, LARGELY DISORGANIZED LIST OF POVRAY SHORT CODE TIPS, TRICKS &
METHODS:
--------------------------------------------------------------
avoid having to specify these. You can also eliminate one of these and still
object definition. For example:
7. Vector expressions with zero values can be shortened as follows:
8. Although rather non-specific, this general approach can be helpful. Search
the features that you want to work with to see where you can get away with
using a default value.
--------------------------------------------------------------
Thanks in advance to all contributors,
Mike C.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
If there is a number followed by another token (like a keyword), the
current POV-Ray parser allows you to skip the whitespace. For example:
diffuse 0.6ambient 0.1
For numbers in the 0-1 range, you don't really need the leading 0 here, so:
diffuse .6ambient .1
And in this particular case, where the number starts with a period
instead of a digit, you can even do this:
diffuse.6ambient.1
Same goes for negative numbers, which start with a dash instead of a digit.
I'm using diffuse and ambient just to give an example. In practice, you
would use *nothing* according to Mike's tip #4 :) But this tip is useful
for other keywords.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 7. Vector expressions with zero values can be shortened as follows:
Also:
"<1,0,1>" becomes x+z
"<2,0,2>" becomes 2*(x+z)
or other combinations
-tgq
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Trevor G Quayle wrote:
>> 7. Vector expressions with zero values can be shortened as follows:
>
> Also:
> "<1,0,1>" becomes x+z
> "<2,0,2>" becomes 2*(x+z)
7 chars -> 7 chars. not much of an improvement ;)
I would suggest in stead: 2-2*y or 2-y-y
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nicolas Alvarez wrote:
> If there is a number followed by another token (like a keyword), the
> current POV-Ray parser allows you to skip the whitespace.
[snip]
In addition, you can seperate tokens by "preprocessor declarations":
sphere{0,1}
or
sphere{0 1}
becomes
sphere{0#local r=.422;1}
Of course this makes only sense if you need the "#local r=.422" anyway :)
Regards,
Florian
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
andrel <a_l### [at] hotmailcom> wrote:
> Trevor G Quayle wrote:
> >> 7. Vector expressions with zero values can be shortened as follows:
> >
> > Also:
> > "<1,0,1>" becomes x+z
> > "<2,0,2>" becomes 2*(x+z)
> 7 chars -> 7 chars. not much of an improvement ;)
> I would suggest in stead: 2-2*y or 2-y-y
Sorry, bad example, more applicable to larger numbers
<20,0,20> -> 20*(x+z)
Probably better to scale the whole scene though instead...
-tgq
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Trevor G Quayle wrote:
>>> 7. Vector expressions with zero values can be shortened as follows:
>>
>> Also:
>> "<1,0,1>" becomes x+z
>> "<2,0,2>" becomes 2*(x+z)
> 7 chars -> 7 chars. not much of an improvement ;)
> I would suggest in stead: 2-2*y or 2-y-y
If you'll need such values *often*, you can #local xz=x+z; Then you can
use 2*xz which is only 4 chars.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Trevor G Quayle wrote:
> andrel <a_l### [at] hotmailcom> wrote:
>> Trevor G Quayle wrote:
>>>> 7. Vector expressions with zero values can be shortened as follows:
>>> Also:
>>> "<1,0,1>" becomes x+z
>>> "<2,0,2>" becomes 2*(x+z)
>> 7 chars -> 7 chars. not much of an improvement ;)
>> I would suggest in stead: 2-2*y or 2-y-y
>
> Sorry, bad example, more applicable to larger numbers
>
> <20,0,20> -> 20*(x+z)
20-20*y is still shorter ;)
>
> Probably better to scale the whole scene though instead...
>
> -tgq
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Mike the Elder" <zer### [at] wyanorg> wrote:
of course, at the cost of flat scenes. It can be useful if you're not going for
photorealistic 3D scenes and is mostly concerned with colors, shapes and
composition.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
One thing I enjoyed playing with and exploiting last time is the default
color maps for POV textures. Using the scale and poly_wave keywords can
create some selectivity within the default colors
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |