SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great...

10
SOL Shape Oriented Language Aditya Narayanamoorthy - Language Guru Gergana Alteva - Project Manager Erik Dyer - System Architect Kunal Baweja - Testing

Transcript of SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great...

Page 1: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

SOLShape Oriented Language

Aditya Narayanamoorthy - Language Guru

Gergana Alteva - Project Manager

Erik Dyer - System Architect

Kunal Baweja - Testing

Page 2: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Why SOL?We wanted:

- a simple, lightweight object-oriented language for creating

2D animations

- the ability to define and create shapes (similar to a class)

- shapes to move as specified by the programmer

- to take away learning a complicated third-party animation

tool, such as OpenGL

Page 3: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Advantages to SOL- Easy to learn

- similar to Java, C++

- Great alternative to C graphics libraries

- Skip learning a complex language library

- Object-oriented

- Easy memory management

- Programmer does not have to worry about memory management

- No memory leaks

- Abstracts cumbersome features in libraries

- No renderers, screens, or external media needed to create and animate shapes

Page 4: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Architecture

Page 5: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Stationary Triangle in SDL 1/2

Page 6: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Stationary Triangle in SDL 2/2

Page 7: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Moving Triangle in SOL

Page 8: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

shape Line {int[2] a;int[2] b;int[2] c;

construct (int[2] a_init, int[2] b_init){

a = a_init;b = b_init;c[0] = (a[0] + b[0]) / 2;c[1] = (a[1] + b[1]) / 2;

}

draw() {drawCurve(a, c, b, 2, [0, 0, 0]);

}}

Building a Shape→ coordinates represented by

int[2]

→ colors by int[3]

→ constructor used to set

coordinates

→ define how coordinates will be

connected with:

- drawPoint(int[2], int[3])

- drawCurve(int[2], int[2],

int[2], int, int[3])

- print(int[2], string, int[3])

→ drawCurve is a bezier curve

that accepts 3 control points

Page 9: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

Rendering the Shape

func main(){int[2] dis;Line l;dis = [200, 0];l = shape Line([1,3], [5,8]);

l.render = {translate(dis, 2);

}}

→ coordinates represented by int[2]

→ declare an instance of the Shape

and pass in corresponding values

→ define a render block for the shape

with any of the following:

- translate(int[2], int)

- rotate(int[2], float, int)

Page 10: SOLsedwards/classes/2017/4115-fall/reports/SOL-presentation.pdf · - similar to Java, C++-Great alternative to C graphics libraries - Skip learning a complex language library ...

DEMO