Context3 - development screenshots

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Context3 - development screenshots

Post by Nom »

Context3 is an attempt to convert Context free design grammars to 3D.
http://koti.mbnet.fi/context3
Image

Code: Select all

rule do {
    do { x .01 
         rz (sin(DD*.42*DD)*18+2.388)   ry .73 
        DEF { row=row+1;DD=DD+.03}}
    2*{x .016 z .006} MESH { }
    2*{x .0016 z .001 } MESH {  layer -1  x (x*.2) RGB 1 1 1
           DEF {mesh=1} }
}

camera { z -.8 }
model { maxshapes 180000}
bg { RGB .2 .2 .2}
Context3 tries to preserve cfdg syntax where it can. It also adds some features to the picture definition idiom.

- affine transforms in 3D, including rotate and skew
- color model is RGBA, with a partial support of HSLA transforms
- user defined color spaces ("shadings") applied on top of the RGBA model
- multiple camera definitions
- layers
- termination of branches based on generation, counted from an ancestor
- a branch-wise push stack of rule summons

- pre/post entry conditions for rules
- expressions with backreference to local variables
- global constants (DEF)

- plugin mechanism for user defined functions[/img]
Last edited by Nom on Thu Oct 08, 2009 11:18 am, edited 5 times in total.

User avatar
xgouchet
Posts: 8
Joined: Tue May 27, 2008 7:05 am
Location: France
Contact:

Post by xgouchet »

wow making a CFDG available in 3D, this is great !
Is there download available to try this, or a beta?
Life would be easier if they gave me the source code.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Post by Nom »

xgouchet wrote:wow making a CFDG available in 3D, this is great !
Is there download available to try this, or a beta?
Downloads are available at the address mentioned above.

Interfaces are provided for interactive (GUI) and command line use, as well as for some programmatic extensions.
Image
Last edited by Nom on Fri Feb 13, 2009 2:11 pm, edited 2 times in total.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Post by Nom »

(see later examples)
Last edited by Nom on Wed Jan 21, 2009 2:06 pm, edited 1 time in total.

User avatar
xgouchet
Posts: 8
Joined: Tue May 27, 2008 7:05 am
Location: France
Contact:

Post by xgouchet »

What renderer are you using for this 3D? Is it a known Open Source 3D rasterizer (like Ogre) or are you creating your own one?
Life would be easier if they gave me the source code.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Post by Nom »

Hi,

currently I'm drawing through java 2D api. It is not great for speed, but its antialiased mode is good to my eye. Architecture is open for new "ShapeReader"/"Canvas" combinations. Suggestions/contribution are welcome also. I'm eager to release the sources but have still some unsolved basic problems and some decisions to make.

ShapeReader is the interface that receives shapes from generate engine, orders them and writes them to canvas. I'm not too familiar with 3D api alternatives, but graphics card enhanced computation would be nice. Two basic requirements that were derived from the spirit of cfdg art are:
- "unlimited" canvas size
- user defined drawing order and multiple camera positions, i.e. the 3D api should not enforce one scene and its own ordering of shapes

Have you any experiences/suggestions where to go next?

There are nice 3D features that come to mind, if a proper api is found...

best regards, Nom

User avatar
xgouchet
Posts: 8
Joined: Tue May 27, 2008 7:05 am
Location: France
Contact:

Post by xgouchet »

Well i took a look at the Sunflow renderer recently, although it can be long to render, images are very cool.
This could be a base for a HighRes render of CFDG 3d images.
Life would be easier if they gave me the source code.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Post by Nom »

I agree that sunflow would make a very nice renderer, and I have been planning to include a sunflow render option at some stage.

Sunflow like and at least some game engines I've looked at has a limitation in that they make their own scene definition. Scene is effectively limited in shape count. That would be against the CFDG axiom of an unlimited number of shapes. Another problem would be the lack of layers. In my view c3dg is not actual 3D but an idiom that mixes multiple 3D spaces and other concepts. This would fight against making Sunflow "the" hires solution in this case, but i agree an interface would make context 3 quite wieldy in some respects, so it will definitely be on context3d schedule when the time arrives... Not to speak of learning a bit more about Sunflow. I've been reading Sunflowcode for some time with great pleasure :)
Last edited by Nom on Mon Aug 11, 2008 1:39 pm, edited 1 time in total.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

[edit:] more examples

Post by Nom »

Image

Code: Select all

DEF fsz .01
shading dim2 { 
    point(0,0) { RGB 0 0 0 s fsz}
    point(1,1) { RGB 1 1 1 s (fsz*5) A .6}
    point(0,1) { RGB 1 0 0 s fsz}
    point(1,0) { RGB 0 1 .3 s fsz}
    A .7
}

rule start { 3*{sy 2} draws { shading dim2 A -.9} }
rule draws {
    50* { x .04 } 50* { y .04 } 
        draw {  d 4 
                col0 (x) col1 (y) 
                z (x*0+rnd()*.1) 
                x -1 y -1 s .012 }

}

rule draw { 
    SQUARE { s 2 6 1 shading -1 RGB 0 0 0 } 
    SQUARE { s 1.1 rz 45} 
    SQUARE { s .5    shading -1 RGB 0 0 0 A 1} 
    draw { s 6 .2 .1 y 10 rx 10 A 1}
}


light vv { point ( .25, .25, 0 ) { RGB 1 1 .6 } s .2 }

bg { R .4 G 0 B 0}
camera { z -2 }
model { minfeaturesize 0 }
Last edited by Nom on Thu Oct 08, 2009 11:19 am, edited 2 times in total.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Some more screenshots

Post by Nom »

Some new patches and properties are available. I'm planning a source release in some near future. The gui will be functional too (is already, but not awfully well functional).

Go to http://koti.mbnet.fi/context3/downloads.php

Image
Image

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Re: Context3 - development screenshots

Post by Nom »

Whilst Context3(d) has gained more stability in recent versions, I'm posting new material for your interest. (Going in version 0.35)

Image

Code: Select all

rule set {
    loop { DEF { re = -1.5 ; im = -1} 
            ry 8
    }
}
rule loop {
    360* { DEF { re=re+.01} }
    169* { DEF { im=im+.01} }

    draw_ { 
        DEF { mcolor =
            saw(re*sqrt(abs(im))*6)+.5
        }
    }
}

rule draw_ { 
draw {x  .3 rx 40 ry (re*100) rx (im*100) z (-.65) s .01 } 
draw {x -.3 ry 60 ry (re*100) rx (im*100) z (-.5) s .01 } 
}
rule draw {
    spike{d 20 shading dim2 col0 (sin(mcolor*10))}
    SQUARE { shading dim2 col0 (sin(mcolor*10))
    }
    CIRCLE { z -.2 
             s (saw(mcolor*20)*1.2+.2)
             L (square(mcolor)+.5) 
             }
}
rule spike {
pre{//abs(re*im)*10000%3000<1.1}
    mcolor%0.3>0.1;mcolor%0.3<0.101
}
    BOX { sx .2}        BOX { sx .02 shading -1 L 1}    
    spike { s .8 .8 1.04 z -1 col0 (col0-.02)}
}
bg {RGB .2 .2 .2}
camera { z -2 }


shading dim2 { 
    point(0) { RGB 0 0 0 s FIEL A 0}
    point(.1) { RGB 1 1 1 s (FIEL*5) A .6}
    point(.5) { RGB 1 0 0 s FIEL}
    point(1) { RGB 0 .4 .3 s FIEL}
    A .7
}
Last edited by Nom on Thu Oct 08, 2009 11:20 am, edited 1 time in total.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

V 4.1

Post by Nom »

Hi!
Just notifying that version 0.41 is available!

Image

shevegen
Posts: 57
Joined: Wed Jul 06, 2005 5:38 am

Post by shevegen »

I am not sure if this critique is wanted, and I think expansion is great because it increases the opportunity for contextfree.

But the other thing is that, as far as I can see, the complexity increases too. I mean, feel free to disregard this, but my concern is that less and less people might use contextfreedesign because it got too complicated.

User avatar
Nom
Posts: 30
Joined: Tue Jan 30, 2007 6:45 am

Post by Nom »

Good point, Shevegen. And thanks for the critique. It is always nice to get thoughtful feedback.

By the rather nonexistent public response to the program (haven't done much marketing either) it seems that its niche is not very large at all.

Other concerns might be mentioned. For instance: resource-consumption by the model in which each shape carries along its own data.

Currently I'm working as a software engineer fulltime, though my interests tend a bit to side literary criticism and literary art in general. As a kickstart, I've found devising the program and derived meta-language skills occassionally useful in the type of software development work I'm doing. As having learned something about modeling and about designing languages while devising it, I feel the program, well... adequately justified..

But context3d (with its shaky name) is not surely violating on Context free's territory? I understand you mean "contextfreedesign" in the sense of the design principles of cfdg scripts, not necessarily juxtaposing these two quite different level programs. I sincerely appreciate the administrative eye and polished touch that the Context free program serves (for free).

aihle
Posts: 2
Joined: Thu Jun 18, 2009 7:02 pm

Post by aihle »

You do realize that a similar attempt to create 3D Context Free Designs already exists?
-> http://structuresynth.sourceforge.net/index.php

I did not read the whole thread in detail but it sounds like Structure Synth does the same.

Post Reply