PROJ 2: 3D INTERACTION & CHANGE OVER TIME

jordanhughes
Posts: 4
Joined: Wed Jan 06, 2016 12:48 pm

Re: PROJ 2: 3D INTERACTION & CHANGE OVER TIME

Post by jordanhughes » Tue Feb 16, 2016 8:15 am

My project was an extension of my 2D project regarding frequently challenged titles. I used the same set of titles for this 3D visualization, however this time I wanted to explore things from a slightly different angle. I wanted to include some of the reasons behind the books being challenged, and I also wanted to include checkout times, dates, and durations for the titles.

I essentially used two queries for this. The first query was a modification of my original query in the first assignment that allowed me to gather unique bib numbers for each of the titles that I had in my list. The second query used the raw transactions table joined with the title table to pull bib numbers, titles, checkout date and time, checkin date and time, and a timestamp difference in hours between the two dates. I used the time stamp difference directly to compute the scale of a particle.

Code: Select all

//Query 1
SELECT DISTINCT checkouts.bibNumber, title FROM spl3.`_rawXmlDataCheckOuts` AS checkouts 
WHERE ((checkouts.title LIKE "%bad boy can be good%") 
OR (checkouts.title LIKE "stolen life a memoir%")
OR (checkouts.title LIKE "starting with alice")
OR (checkouts.title LIKE "%tango makes three%")
OR (checkouts.title LIKE "%athletic shorts%")
OR (checkouts.title LIKE "bless%ultima%") 
OR (checkouts.title LIKE "bone vol 1%")
OR (checkouts.title LIKE "brave new world")
OR (checkouts.title LIKE "adventures of captain underpants%")
OR (checkouts.title LIKE "crank")
OR (checkouts.title LIKE "drama")
OR (checkouts.title LIKE "fifty shades of grey")
OR (checkouts.title LIKE "flashcards%life%")
OR (checkouts.title LIKE "gossip girl")
OR (checkouts.title LIKE "golden compass")
OR (checkouts.title LIKE "i know why the caged bird%")
OR (checkouts.title LIKE "its perfectly normal%")
OR (checkouts.title LIKE "looking for alaska")
OR (checkouts.title LIKE "lush")
OR (checkouts.title LIKE "my moms having a baby%")
OR ( checkouts.title LIKE "my sisters keeper a novel")
OR ( checkouts.title LIKE "nickel and dimed on%")
OR ( checkouts.title LIKE "olives ocean")
OR ( checkouts.title LIKE "persepolis")
OR ( checkouts.title LIKE "revolutionary voices%")
OR ( checkouts.title LIKE "saga volume one")
OR ( checkouts.title LIKE "scary stories to tell%")
OR ( checkouts.title LIKE "absolutely true diary%")
OR (checkouts.title LIKE "adventures of huckleberry finn")
OR (checkouts.title LIKE "bluest eye")
OR (checkouts.title LIKE "catcher in the rye")
OR (checkouts.title LIKE "chocolate war")
OR (checkouts.title LIKE "color of earth")
OR (checkouts.title LIKE "color purple")
OR (checkouts.title LIKE "earth my butt%")
OR (checkouts.title LIKE "glass castle")
OR (checkouts.title LIKE "hunger games")
OR (checkouts.title LIKE "kite runner")
OR (checkouts.title LIKE "perks of being%")
OR (checkouts.title LIKE "thirteen reasons why%")
OR (checkouts.title LIKE "to kill a mockingbird")
OR (checkouts.title LIKE "ttyl%" AND callNumber LIKE "%myracle%")
OR (checkouts.title LIKE "twilight")
OR (checkouts.title LIKE "uncle bobby%")
OR (checkouts.title LIKE "what my mother does%"))
AND ((checkouts.checkout BETWEEN "2005-01-01" AND "2014-12-31")
AND (checkouts.`itemType` LIKE  "%bk%"))
ORDER BY title, checkout

//Query 2
SELECT title.title, txs.checkOut, txs.checkIn, txs.bibNumber, TIMESTAMPDIFF(HOUR, checkOut, checkIn) FROM spl3.`x_rawTransactions` as txs INNER JOIN spl3.`title` as title ON txs.`bibNumber` = title.`bibNumber`
WHERE ((DATE(txs.`checkOut`) >= "2006-01-01")) AND (checkIn IS NOT NULL) AND (txs.checkIn <= "2014-12-31")
AND (txs.bibNumber IN ('2453513', '2481055', '2746344', '2946060', '1757322','1632693', '1285221', '789957', '2166836', '547742', '1585918', '1644533', '1710746', '1370906', '1669075', '2414922', '2622715', '2716010', '2298706', '636150', '1634827', '2335915', '2452772', '3036722', '2227295', '1352046', '2525744', '124499', '1364051', '1923085', '2356219', '1987343', '1632629', '1285181', '2432782', '1285187', '66182', '1285189', '2573890', '1275101', '1632697', '1896500', '2372793', '2266835', '2689055', '3003535', '2812375', '2806542', '2196807', '2794842', '2862544', '2338323', '2612334', '2176385', '1659144', '2367748', '2306851', '2108336', '2507346', '2611504', '2665213', '1680627', '51344', '1833250', '491437', '2713673', '3010908', '1400520', '2629285', '3043012', '2170183','2197365', '2078798', '2447827', '2286653', '2390676', '2417282', '2296278', '2229627', '2244560', '2041508', '2162719', '2811214', '2208430', '1898787', '2183402', '2001667', '2841844', '464739', '203806', '2689855', '2142232', '2724328', '2674415', '1287304', '1975241', '1612258', '2391663', '2658714', '2238563', '2294743', '2831674', '2307613', '2280207', '2024643', '2123403', '2135876', '2335250', '2318828', '2146035', '2357004', '488263', '2458643', '2551743', '2689016', '2689233', '2967782', '2382573', '2479926', '2078709', '2176401'))
ORDER BY txs.checkOut
The processing code is attached, but the idea with the visualization was to create a particle for every checkout per title on the x axis, time on the y axis, and date on the z-axis. Initially, I had planned to have all books showing each of their particles, but the amount of particles was around 100k and was a little much for my system when I added the particle motion on top of it. So I restricted the x-axis to a single book which is filterable by a drop down menu control in the sketch. When the 'p' keyboard button is pressed, the particles move from their checkout date and time on the left to their check in date and time on the left. The particles themselves are rotating circles of lines, so when they move it generates a helix looking formation. The radius of the helix is directly proportional to the checkout time, so longer checkouts have larger circles.

Additionally, the colors of the particles themselves are randomly generated from the set of possible "challenged" categories that the book falls into. This is to give the user a sense of the reasons that particular book was placed on the list.
Screen Shot 2016-02-16 at 8.09.08 AM.png
Screen Shot 2016-02-16 at 8.08.55 AM.png
Screen Shot 2016-02-16 at 8.06.41 AM.png
Screen Shot 2016-02-16 at 8.05.42 AM.png
Attachments
Main3D.zip
(1.12 MiB) Downloaded 146 times

hkung
Posts: 4
Joined: Wed Jan 06, 2016 12:47 pm

Re: PROJ 2: 3D INTERACTION & CHANGE OVER TIME

Post by hkung » Tue Feb 16, 2016 8:38 am

For this project I did the visualization of the checkout numbers of the books students at Princeton University are required to read from January 2006 to December 2014 (52*9=468 weeks) according to http://qz.com/602956/these-are-the-book ... d-to-read/. I still need to work on the shape of the polygon plots to make them 3D. Then I will show the call number information using 3D contour objects with different colors.
My query runs as follows.

Code: Select all

SELECT
    title, 
    year(checkouts.checkOut),
    WeekOfYear(checkouts.checkOut),
    checkouts.callNumber
    
 
FROM spl3._rawXmlDataCheckOuts AS checkouts 
 
WHERE checkouts.title LIKE "Republic" 
	AND (checkouts.callNumber LIKE "%PLATO%" OR checkouts.callNumber LIKE "%321%")
	AND ((checkouts.checkOut BETWEEN "2006-01-01" AND "2014-12-31") AND (checkouts.itemType LIKE "%bk%"))
     
ORDER BY year(checkouts.checkOut), WeekOfYear(checkouts.checkOut)
My python code runs as follows.

Code: Select all

from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.colors import LightSource
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection
from matplotlib.colors import colorConverter

import csv
from linkedlist import Node, LinkedList
import numpy as np

(TITLE, YEAR, MONTH, CALLNUMBER) = range(4)
gBookList = ["republic", \
             "leviathan", \
             "prince", \
             "clashOfCivilizations", \
             "elementsOfStyle", \
             "ethics", \
             "structureOfScientificRevolutions", \
             "democracyInAmerica", \
             "communistManifesto", \
             "politics"]

gStartYear, gEndYear = 2006, 2014
gStartMonth, gEndMonth = 1, 52
gZ = []


def cc(arg):
    return colorConverter.to_rgba(arg, alpha=0.6)


def load_csv(fileName, ls):
    with open(fileName, 'rb') as inFile:
        hasHeader = csv.Sniffer().has_header(inFile.read(1024))
        inFile.seek(0)  # rewind
        inCSV = csv.reader(inFile)
        if hasHeader:
            next(inCSV)  # skip header row
        # data = [[row[0], eval(row[1]), eval(row[2]), row[3]] for row in inCSV]
        ls = LinkedList()
        for row in inCSV:
            ls.add_tail([row[TITLE], 
                                 eval(row[YEAR]), 
                                 eval(row[MONTH]), 
                                 row[CALLNUMBER]])
                # zCount += 1
            # curYear, curMonth = eval(row[YEAR]), eval(row[MONTH])
        
        # print republicList.head.get_next().get_data()

    _z = [0]
    entry = ls.head
    if entry != None:
        for curYear in range(gStartYear, gEndYear + 1):
            curMonth = gStartMonth
            while curMonth <= gEndMonth:
                if entry != None:
                    if curYear == entry.get_data()[YEAR] and \
                        curMonth == entry.get_data()[MONTH]:
                        _z[len(_z)-1] += 1
                        entry = entry.get_next()
                        curMonth -= 1
                    else:
                        _z.append(0)
                else:
                    _z.append(0)
                curMonth += 1
    del _z[-1]
    print zip(*[iter(_z)]*52)
    print "\n\n"
    
    return _z

if __name__ == '__main__':
    bookList = LinkedList()
    for book in gBookList:
        bookList.add_tail(book)
        gZ.append( load_csv(book + '.csv', bookList.search(book)) )

    zs = np.array(gZ)
    nrows, ncols = zs.shape
    
    xs = np.linspace(1, ncols, ncols)
    xs = np.insert(xs, 0, 0)
    xs = np.append(xs, [ncols + 1])
    
    ys = np.linspace(1, nrows, nrows)
    # zs = zs.ravel()
    verts = []
    for idx, val in enumerate(ys):
        newZs = np.insert(zs[idx, :], 0, 0)
        newZs = np.append(newZs, [0])
        verts.append(list(zip(xs, newZs)))
    
    fig = plt.figure()
    fig.set_size_inches(18.5, 10.5, forward=True)
    ax = fig.gca(projection='3d')    
    
    poly = PolyCollection(verts, facecolors=[cc('r'), cc('g'), cc('b'), cc('y'), cc('r'), cc('g'), cc('b'), cc('y'), cc('r'), cc('g')])
    
    poly.set_alpha(0.7)
    ax.add_collection3d(poly, zs=ys, zdir='y')
    
    ax.set_xlabel('MONTH')
    ax.set_xlim3d(-10, ncols)
    
    # ax.set_ylabel('BOOKS TITLE')
    ax.set_ylim3d(1, 10)
    ax.w_yaxis.set_ticklabels(gBookList)
    
    ax.set_zlabel('CHECKOUT #')
    ax.set_zlim3d(0, 8)
    
    plt.show()    
Further I have defined my linked list data structure by using and modifying the code at https://www.codefellows.org/blog/implem ... -in-python and http://www.science.smith.edu/dftwiki/in ... _in_Python
My linked list data structure is defined as

Code: Select all

class Node(object):

    def __init__(self, data=None, next_node=None):
        self.data = data
        self.next_node = next_node

    def get_data(self):
        return self.data

    def get_next(self):
        return self.next_node

    def set_next(self, new_next):
        self.next_node = new_next


class LinkedList(object):

    def __init__(self, head=None):
        self.head = self.tail = head
    
    def add_front(self, data):
        new_node = Node(data)
        new_node.set_next(self.head)
        if self.head == None:
            self.tail = self.head = new_node
        else:
            self.head = new_node

    def add_tail(self, data):
        if self.head == None:
            self.add_front(data)
        else:
            new_node = Node(data)
            new_node.set_next(None)            
            self.tail.set_next(new_node)
            self.tail = self.tail.get_next()        

    def size(self):
        current = self.head
        count = 0
        while current:
            count += 1
            current = current.get_next()
        return count

    def search(self, data):
        current = self.head
        found = False
        while current and found is False:
            if current.get_data() == data:
                found = True
            else:
                current = current.get_next()
        if current is None:
            raise ValueError("Data not in list")
        return current
***UPDATE***
I implemented the midpoint displacement algorithm and rewrote my program using Processing and Peasycam. Future work includes coloring the polygons and increasing the input data.
Attachments
MidptDisp.zip
(119.18 KiB) Downloaded 153 times
draw3D.zip
(2.47 KiB) Downloaded 153 times
midptdisp.jpg
polys1.jpg
polys.jpg
Untitled.jpg
figure_1-3.png
figure_1-2.png
figure_1-1.png
figure_1-4.png
figure_1.png
Last edited by hkung on Wed Feb 24, 2016 11:17 am, edited 3 times in total.

markhirsch8
Posts: 3
Joined: Wed Jan 06, 2016 1:43 pm

Bi-Polar Books

Post by markhirsch8 » Tue Feb 16, 2016 9:50 am

Within the SPL database there exists an issue in the relationship among Bibliography Numbers, Item Numbers, and Bar Codes. Namely, one bibliography may have a number of items associated with (all with the same checkout count...which is impossible). At the same time, these different item numbers all have unique bar codes with different checkout counts associated with them.

In a sense, the database presents books that are being pulled in two contrasting directions depending on what data we use as a lens to see the books through. This visualization aims to represent this break in the system and the chaos is creates.



MySQL Query

Code: Select all

select 
*
from
	spl3.x_markHirsch,
    spl3.x_oneBibManyItem
    
where
	spl3.x_markHirsch.bibNumber = spl3.x_oneBibManyItem.bibNumber

Processing Code attached below
Attachments
SPL_3D_Data_Viz.zip
(704.78 KiB) Downloaded 145 times
IMG_3475.JPG
IMG_3474.JPG
Screen Shot 2016-02-20 at 4.35.12 PM.png
Screen Shot 2016-02-20 at 4.34.54 PM.png
Screen Shot 2016-02-20 at 4.34.37 PM.png
Last edited by markhirsch8 on Sat Feb 20, 2016 4:42 pm, edited 2 times in total.

thomasahervey
Posts: 4
Joined: Wed Jan 06, 2016 12:50 pm

Visualizing SPL Book Age, Popularity and Adoption Rates (3D)

Post by thomasahervey » Tue Feb 16, 2016 9:59 am

While my 2D visualization still needs some updating, I have decided to continue with my previous project's dataset to create an interactive 3D visualization. To give a background recap, I am interested in exploring not individual books or trends, but rather overall trends within the book media itself. Since Seattle is a progressive and technology oriented city, I proposed the questions: Is there a relationship between book adoption rate and checkout frequency? Does publication date play a role on adoption and/or frequency? Are there any noticeably different trends between book genre types? These questions play with the idea that book and other physical media may decrease in popularity (both checkout and adoption rate at the library) as e-media increases.

Using and modifying some previous queries as well as introducing the following, has given me a cleaner dataset than my previous project.

Code: Select all

SELECT
    coca.itemNumber,

    sum(x_checkOutCountAnnual.2006) as 2006,
    sum(x_checkOutCountAnnual.2007) as 2007,
    sum(x_checkOutCountAnnual.2008) as 2008,
    sum(x_checkOutCountAnnual.2009) as 2009,
    sum(x_checkOutCountAnnual.2010) as 2010,
    sum(x_checkOutCountAnnual.2011) as 2011,
    sum(x_checkOutCountAnnual.2012) as 2012,
    sum(x_checkOutCountAnnual.2013) as 2013,
    sum(x_checkOutCountAnnual.2014) as 2014,
    sum(x_checkOutCountAnnual.2015) as 2015,
    
    ib.itemNumber as ib_ItemNum,
    ib.bibNumber as ib_BibNum,
    
    it.itemNumber as it_ItemNum,
    it.itemType as it_ItemNum,
    bibNumber
    web.bib as web_Bib,
    web.type as web_Type
FROM
    spl.x_checkOutCountAnnual coca
        INNER JOIN
    spl.itemToBib ib ON coca.itemNumber = ib.itemNumber
        INNER JOIN
    spl.itemType it ON ib.itemNumber = it.itemNumber
        INNER JOIN
    spl3.x_splOrgWebScraping web ON web.bib = ib.bibNumber
WHERE
    (it.itemType = 'acbk' OR it.itemType = 'arbk'
        OR it.itemType = 'bcbk'
        OR it.itemType = 'drbk'
        OR it.itemType = 'jcbk'
        OR it.itemType = 'jrbk')
        AND (web.type >= 2006)
        
		group by ib.bibNumber
        order by ib.bibNumber
Overall, I have been successful in generating an interactive 3D data visualization that provides novel insight. The following images show different perspectives of my vaisualization, which for the most part is an interactive 3D line graph. The green bars represent the library's adoption rate (first checkout - publication date) while the lines show total checkouts per year over the years that the library has been open. While I still need to revisit this visualization to increase its interactive ability, currently, a user can adjust color based on total checkouts or publication (also x-axis) to better understand the distribution.
Attachments
assignment3.zip
(143.21 KiB) Downloaded 140 times
4.png
3.png
2.png
1.png

xindi
Posts: 8
Joined: Wed Jan 06, 2016 1:39 pm

Re: PROJ 2: 3D INTERACTION & CHANGE OVER TIME

Post by xindi » Mon Mar 07, 2016 10:27 pm

Aurora Activity Visualization ------ Xindi Kang
Conceptually this project is an extension of my first 2D project.
In the first project, I visualized the relationship between the popularity of the books related to "Aurora" or "Northern Light" and the fluctuations in Aurora intensity at the North Pole.

For mining the data from SPL there are 9 queries that are the same except for the years of check out (2006-2014).
I filtered out the irrelevant books with NOTLIKE.
Below is the first query.

Code: Select all

SELECT 
    FLOOR(deweyClass) AS Dewey,
    DATE_FORMAT(checkOut, '%Y-%m-%d') AS checkOutDates,
    COUNT(checkout) AS CheckoutCount,
    TITLE,
    bibNumber
FROM
    spl3._rawXmlDataCheckOuts
WHERE
    (title LIKE '%aurora%'
        OR title LIKE '%northern light%'
        OR title LIKE '%polar light%')
        AND title NOT LIKE '%aurora county%'
        AND title NOT LIKE '%teagarden%'
        AND title NOT LIKE '%perfect party%'
        AND title NOT LIKE '%quilt%'
        AND title NOT LIKE '%Aurora Brigida y Carlos%'
        AND title NOT LIKE '%means dawn%'
        AND title NOT LIKE '%Andrew Reale%'
        AND title NOT LIKE '%Pliny%'
        AND title NOT LIKE '%Aurora West%'
GROUP BY checkOutDates
ORDER BY SUM(CASE
    WHEN
        (YEAR(checkOut) >= 2006
            OR YEAR(checkOut) <= 2016)
    THEN
        1
    ELSE 0
END) DESC
For the visualization I aim to develop a 3D perspective of this relation.

I used a Spherical Coordinate System as the foundation of this visualization.

[img]
coordinates.png
[/img]

Interactions:
[img]
2005OverView.png
press "1" to see the data from 2005 (2 for 06, 3 for 07, 4 for 08 etc.)
[/img]

[img]
DatePoints.png
press "D" to see the dates
[/img]

[img]
DeweyPoints.png
press "Y" to see the Dewey Classes
[/img]

[img]
YearSelection.png
keys "1,2,3,5,6,8" are pressed to show the data from 2005,2006,2007,2009,2010 and 2012
[/img]

[img]
All year.png
The visual effect of all 9 years
[/img]

Processing Code:
Full Code Folder Zip file containing CSV files and other Tabs is attached

Main Code:

Code: Select all

import controlP5.*;
ControlP5 cp5;

import peasy.*;
//import peasy.org.apache.commons.math.*;
//import peasy.org.apache.commons.math.geometry.*;
//import peasy.test.*;

PeasyCam cam;

PeasyCam camera;

int numRows;

Table[] tables = new Table[10];
ArrayList<aurora> auroraVis = new ArrayList<aurora>();

float furGrowth = 3; 

int xo=0;
int yo=0;
int zo=0;

//***********for reference point***********
int xa=100;
int ya=-90;
int za=70;

float sphereSize = sqrt(sq(xa)+sq(ya)+sq(za));

boolean dateLable = false; 
boolean deweyLable = false; 
boolean test = false;
boolean Fur1;
boolean Fur2;
boolean Fur3;
boolean Fur4;
boolean Fur5;
boolean Fur6;
boolean Fur7;
boolean Fur8;
boolean Fur9;

//***********for points**********

float xp;
float yp;
float zp;

//*********for date lable***********
int i;
int a;

void setup() {
  size(1000, 760, P3D);
  //camera = new PeasyCam(this, 0, 0, 0, 50);
  cam = new PeasyCam(this, width/2, height/2, 0, 200);
  //cam.setMinimumDistance(500);
  //cam.setMaximumDistance(4000);

  for (int i=1; i<10; i++) {
    tables[i] = loadTable("Aurora_NL"+ i +".csv", "header");
  }

  for (int count = 1; count < 10; count++) {
    numRows = tables[count].getRowCount();
    //println("number of rowz:" + numRows);

    for (int i=0; i<numRows; i++) {
      String dates= tables[count].getString(i, 0);
      int checkOut= tables[count].getInt(i, 1);
      int dewey = tables[count].getInt(i, 2);
      int intensity = tables[count]. getInt(i, 3);
      //println(checkOut);

      auroraVis.add(new aurora(dates, checkOut, dewey, intensity, count));
    }
    //buttons();
  }

  //println("DATASize: " + auroraVis.size());
}
void draw() {
  background(0);
  translate(width/2, height/2);

  datePoints();

  //dateMode();
  //reference();
  if (Fur1) fur(1);
  if (Fur2) fur(2);
  if (Fur3) fur(3);
  if (Fur4) fur(4);
  if (Fur5) fur(5);
  if (Fur6) fur(6);
  if (Fur7) fur(7);
  if (Fur8) fur(8);
  if (Fur9) fur(9);

  if (dateLable) DateLable();
  if (deweyLable) DeweyLable(i, xp, yp, zp);
  if (test) Test();
  reference();
}

void fur(int a) {

  hint(DISABLE_DEPTH_TEST);
  cam.beginHUD();
  text(a + "." + "table"+ (a + 2004), 30, (50+a*10));
  cam.endHUD();
  hint(ENABLE_DEPTH_TEST);
  for (int i=0; i<auroraVis.size(); i++) {

    if (auroraVis.get(i).tablenumber == a) {

      float rho = map(auroraVis.get(i).checkOut, 8, 135, sphereSize, -sphereSize); 
      float phi = map(auroraVis.get(i).dewey, 1, 954, PI, -PI);
      float theta = map(monthParser(auroraVis.get(i).dates), 0, 12, 0, 2*PI);

      //println("rho:"+ rho);
      //println("phi:"+ phi);
      //println("theta:"+ theta);

      float x = rho * cos(theta) * sin(theta);
      float y = rho * sin(phi) * sin(theta);
      float z = rho * cos(phi);

      //println("x:"+ x);
      //println("y:"+ y);
      //println("z:"+ z);

      float xb = x * furGrowth;
      float yb = y * furGrowth;
      float zb = z * furGrowth;

      float r = random(255);
      float g = random(255);
      float b = random(255);

      //float r = 255;
      //float g = 255;
      //float b = 255;


      beginShape(LINES);
      stroke(r, b, g,60);
      strokeWeight(10);
      //vertex(0, 0, 0);
      vertex(x, y, z);
      vertex(xb, yb, zb);
      endShape();

      // *********Draw Dewey Points*******
      float rhoD = sphereSize;
      float phiD = map(auroraVis.get(i).dewey, 1, 954, PI, -PI);
      float thetaD = 2*PI;
      //float theta = monthParser(auroraVis.get(i).month) * PI/6;

      float xp = rhoD * cos(thetaD) * sin(phiD);
      float yp = rhoD * sin(phiD) * sin(thetaD);
      float zp = rhoD * cos(phiD);

      stroke(255, 255, 255, 100);
      strokeWeight(15);
      point(xp, yp, zp);
      pushMatrix();
      translate(xp, yp, zp);
      rotateX(PI/2);
      translate(-xp, -yp, -zp);
      //text(auroraVis.get(i).dewey, xp, yp, zp);
      if (deweyLable) DeweyLable(i, xp, yp, zp);
      popMatrix();
    }
  }
}


void datePoints() {
  float xp = 0; 
  float yp = 0; 
  float zp = 0; 

  for (int i=0; i<auroraVis.size(); i++) {

    //println("month: "+ str(monthParser(auroraVis.get(i).month)));

    float rho = sphereSize;
    //float phi = map(auroraVis.get(i).dewey, 1, 954, PI, -PI);
    float phi = PI/2;
    float theta = map(dateParser(auroraVis.get(i).dates), 0, 12, 0, 2*PI);
    //float theta = monthParser(auroraVis.get(i).month) * PI/6;

    xp = rho * cos(theta) * sin(phi);
    yp = rho * sin(phi) * sin(theta);
    zp = rho * cos(phi);

    stroke(255);
    strokeWeight(10);
    point(xp, yp, zp);
    //text(monthParser(auroraVis.get(i).dates), xp, yp, zp);
    //dateLable(i,xp, yp, zp);
  }
}

P.S.
Sorry for uploading my project so late
As an Art student I had extremely high expectation for the visual quality of my project. Since I was fairly satisfied with my first project visually, I imagined that the visual effect of the 3D project to be shaped similar to the Aurora Borealis strips in real life (with the color changing and wavering effects). But as I was implementing the coordinates, I realized how hard it would be to actually achieve my goal. (I assume it's gonna take another whole year for me to actually do it). So for now, my project looks nothing like that. However, I am satisfied with what I achieved now. I really enjoyed the process and I definitely learned A LOT.
Attachments
FinalSelfSketch_new.zip
(114.46 KiB) Downloaded 112 times

Post Reply