|
 |
"jr" <cre### [at] gmail com> wrote:
> hi,
>
> "ingo" <nomail@nomail> wrote:
> > ...
> > object:
> > sphere:
> > center<0, 0, 0>
> > radius<1>
> > material:
>
> JSON has been mentioned elsewhere as a replacement (?) or as a component of the
> "new SDL". it would (I guess) make a real good storage format for objects (like
> above), or materials/textures libraries, etc.
>
object and material are just containers, lists/arrays..
there are a few specialised ordered lists with an operator attached, union,
intersect etc.
A povObject/shape is like a specific composed dictionary/struct/record as is
texture. One could define it all in SQLite:
CREATE TABLE IF NOT EXISTS sphere(
//centre: ah, there is no vector type but we could crate a table for that
id INTEGER PRIMARY KEY NOT NULL,
name TEXT UNIQUE,
centre INTEGER REFERENCES vector(id),
radius REAL DEFAULT 1.0,
material INTEGER REFERENCES material(id)
)STRICT;
CREATE TABLE IF NOT EXISTS vector(
id INTEGER PRIMARY KEY NOT NULL, // or use a string formatted as '<x,y,z>'?
x REAL NOT NULL,
y REAL NOT NULL,
z REAL NOT NULL
)STRICT;
etc. etc. who needs type-systems and OOP if you have a database ;)
ingo
Post a reply to this message
|
 |