|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I'm very new at Povray.
I have the matrices whose rows constitute normal vectors, and coefficients
of quadratics, isn't there anything in Povray so that when I define my
matrices, I can access elements say matrix is M, then M(i,j) is (i,j) th
element.
If there is no such thing, how to read data from a text file (I will put my
matrices in a text file)?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Katherina <nomail@nomail> wrote:
> I have the matrices whose rows constitute normal vectors, and coefficients
> of quadratics, isn't there anything in Povray so that when I define my
> matrices, I can access elements say matrix is M, then M(i,j) is (i,j) th
> element.
If all you want to do is to be able to "easily" handle a set of values
as if they were a matrix, you could create a 2-dimensional array from them:
http://povray.org/documentation/view/3.6.1/233/
Note, however, that POV-Ray offers no native matrix operations (such
as addition, multiplication, etc) doable to such "matrix" arrays, so if
you need those operations you'll have to implement them yourself. This
should be more or less trivial to do using #macros.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> Katherina <nomail@nomail> wrote:
> > I have the matrices whose rows constitute normal vectors, and coefficients
> > of quadratics, isn't there anything in Povray so that when I define my
> > matrices, I can access elements say matrix is M, then M(i,j) is (i,j) th
> > element.
>
> If all you want to do is to be able to "easily" handle a set of values
> as if they were a matrix, you could create a 2-dimensional array from them:
>
> http://povray.org/documentation/view/3.6.1/233/
>
> Note, however, that POV-Ray offers no native matrix operations (such
> as addition, multiplication, etc) doable to such "matrix" arrays, so if
> you need those operations you'll have to implement them yourself. This
> should be more or less trivial to do using #macros.
>
> --
> - Warp
Thanks a lot, I do not need matrix operations.
I looked at the link that you sent to me, but my problem is that I have a
huge data and there are no commas between elements and also between rows as
in the Povray definition below:
#declare Digits =
array[4][10]
{
{7,6,7,0,2,1,6,5,5,0},
{1,2,3,4,5,6,7,8,9,0},
{0,9,8,7,6,5,4,3,2,1},
{1,1,2,2,3,3,4,4,5,5}
}
Since it is not possible to put commas and also brcakets with to huge data
(if there is a way to do this not by hand please let me know) what can I
do?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Katherina" <nomail@nomail> wrote:
> Since it is not possible to put commas and also brcakets with to huge data
> (if there is a way to do this not by hand please let me know) what can I
> do?
What are you using to edit text and how consistant is the formmating of your
data, and just how huge? There's a good chance your text editor could help
automate the addition of commas. For example, if there's one space between
each number, then you could do a simple text replacement of all instances of
a " " with a ", ". Text (brackets/commas) at the beginning and end of the
line could be added with an editor-macro.
Charles
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Katherina <nomail@nomail> wrote:
> I looked at the link that you sent to me, but my problem is that I have a
> huge data and there are no commas between elements and also between rows as
> in the Povray definition below:
If there are no negative numbers then it's actually possible to read them
as if they were separated by commas (by using #fopen and then a #while loop
with a #read inside it to read the values from the file and assign them to
the array). If there are negative values, however, then it's not possible
(because povray will interpret it as a substraction of two numbers).
Depending on how the file is formatted it may be easy to search&replace
whitespace with commas with almost any text editor.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Charles C" <nomail@nomail> wrote in message
news:web.46b61f02ce12c1a4c667cf480@news.povray.org...
> "Katherina" <nomail@nomail> wrote:
>> Since it is not possible to put commas and also brcakets with to huge
>> data
>> (if there is a way to do this not by hand please let me know) what can I
>> do?
>
> What are you using to edit text and how consistant is the formmating of
> your
> data, and just how huge? There's a good chance your text editor could
> help
> automate the addition of commas. For example, if there's one space
> between
> each number, then you could do a simple text replacement of all instances
> of
> a " " with a ", ". Text (brackets/commas) at the beginning and end of the
> line could be added with an editor-macro.
> Charles
>
Many text editors also allow you to edit in a columnar way, so you don't
necessarily need a macro.
For example, the editor in the Windows version of POV-Ray allows you to
Ctrl-Click to select a column of text.
If you click at the start of the first line, then scroll down to the bottom
and Shift-Ctrl-Click at the start of the last line, you get a cursor that
runs down in front of the first column and you can type a '{' symbol in
front of each line. You can do the same on the far left of the file.
Regards,
Chris B.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> If you click at the start of the first line, then scroll down to the bottom
> and Shift-Ctrl-Click at the start of the last line, you get a cursor that
Neat/thanks. I frequently use shift and ctrl clicking separately, but
somehow it never occurred to me to use both at once. :)
Charles
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Charles C" <nomail@nomail> wrote:
> "Chris B" <c_b### [at] btconnectcomnospam> wrote:
> > If you click at the start of the first line, then scroll down to the bottom
> > and Shift-Ctrl-Click at the start of the last line, you get a cursor that
>
> Neat/thanks. I frequently use shift and ctrl clicking separately, but
> somehow it never occurred to me to use both at once. :)
> Charles
Thanks a lot! It really helped me! :)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|