Jump to content
  • Advertisement

foreignkid

Member
  • Content Count

    83
  • Joined

  • Last visited

Community Reputation

142 Neutral

About foreignkid

  • Rank
    Member
  1. foreignkid

    Dating a taller girl - weird to find it weird?

    Quote:Original post by HunterCyprus93 I agree man, what's the worst thing that could happen? She tells you yeah, I am getting married/seeing someone. So you move on. Or... You move on without ever asking her and like someone else said "you will regret the things you didnt' do the rest of your life". I say go for it as well. On the positive side, maybe she's testing your persistence! I would keep pursuing things. I figure that the worst thing that can happen is, well, things don't work out, and you're forced to move on to one of the other 3 billion or so girls in the world. Anyhow, best of luck. In any case, you'll get some experience dealing with awkward-feeling situations.
  2. foreignkid

    How 'bout Team Fortress 2?

    Previous thread about TF2 Edit: linkification I really like TF2. Other than a couple of bugs (ie crash on launching fullscreen) during the beta, I have only had good experiences with it. For some reason, it seems like I'm better at TF2 that other FPSes that I occasionally play online- I'm usually in the top half of the charts, despite only getting to game every month or so. Most of my time has been spent in finishing up the Portal challenges the past couple weeks, but I have definitely enjoyed TF2. Great presentation.
  3. foreignkid

    Resumes and jobs, oh my!

    Quote:Original post by daviangel Quote:Original post by foreignkid Quote:Original post by xanin I believe in the States its illegal for a potential employer to ask that. I think this is true. Yup, it's against federal law: In a nutshell, employers should not be asking about your race, gender, religion, marital status, age, disabilities, ethnic background, country of origin, sexual preferences or age. On the other hand it might cost you a job if you refuse? Refuse to answer the question which might cost you the job if you are very uncomfortable with the question. However, consider whether you really want to work somewhere where you are asked questions that are not appropriate. One exception to this is if you work for a company that does government contracts that require it. For instance, you might have a job in which you are required to deal with information that cannot be disclosed to non-US citizens: see NOFORN in http://en.wikipedia.org/wiki/Classified_information_in_the_United_States#Unclassified . Anyway, back to the topic- any further recommendations on the resume?
  4. foreignkid

    Resumes and jobs, oh my!

    Quote:Original post by xanin I believe in the States its illegal for a potential employer to ask that. I think this is true.
  5. foreignkid

    Resumes and jobs, oh my!

    Quote:Original post by jpetrie I do, however, wonder what position you're applying for here? Usually this is stated in an "objective" section (which I personally find annoying and useless), but your "summary" doesn't bother. I'm wondering why you list a bunch of programming and engineering qualifications, followed by some mechanical labor qualifications. There is rarely a need for a position involving both. Quote:Original post by jpetrie I would trim the experience section a lot. Include only what is relevant to the position you're applying for, the rest is just fluff and filler. It's fine if you resume is only one page and looks sparse -- you're a student. Most people don't end up with two-page resumes until later in their careers. I don't necessarily think that two-page resumes are evil, in and of themselves, but only if they contain a lot of relevant information. Most of the stuff you've got seems like filler; it should be trimmed and targeted for a specific position. This isn't for a particular job at the moment- I'm just trying to get something down at this point. My intention is to use this as a starting point when getting resumes together for future job applications, mainly by trimming parts away from this resume that really aren't relevant to whatever job I am applying for at that point. As for the summary section, I hate summary/objective statements- it seems like people are fairly divided as to whether or not they are really necessary. I ended up taking it out, but now it seems as if there's no real introduction, and the reader is just thrown immediately into bulleted lists.
  6. foreignkid

    Resumes and jobs, oh my!

    So, its time for me to start applying for summer jobs, and I've been getting my resume together. I hate writing resumes, and trying to sell myself to potential employers, but that's the way the game appears to be played. I'm looking for feedback on my current resume: html pdf (no special formatting at this time- just a dump of the html basically) I'm looking for feedback mainly in the following areas: * What can I do better formatting wise? * Is there anything else I need to include? * Anything else, really. This is kind of the general all-inclusive version of my resume. I've been told that its good to only include relevant experience in resumes that you send in for particular jobs, so I will be trimming this down when I send it in with applications (by removing irrelevent stuff). Also, if anybody else wants to post up their resume in this thread for comparison/feedback, I think that would definitely be acceptable. TIA Lee Baker [Edited by - foreignkid on April 27, 2007 12:04:58 PM]
  7. foreignkid

    Procedural Creation of Plants

    One of the guys on my team for a school project last year implemented an algorithm that he found (http://www.cs.mcgill.ca/~svasil/557/Report557.htm). I've never looked at that link until today, but I think it turned out some fairly good results. It appears to follow an idea similar to that given in chapter 9 of the More OpenGL Game Programming book (glbook.gamedev.net). Basically, the idea (presented in the book) is to recursively build a tree of shorter branches out to a certain depth, and branch these branches at somewhat random angles. Pseudocode: branch makeSomeBranch(length, branch_angle, depth) { if(depth == 0) return NULL; branch b = new branch(); for(int i = 1..4) b.addChildBranches( makeSomeTrees(0.7 * lenght, 0.8 * branch_angle, depth-1)); return b; } called with something like makeSomeTree(10feet, 60 degrees, 4) initially. The code that my teammate wrote doesnt do it recursively, but instead uses separate parameters for each depth. We ended up using a kind of square prism shape (no idea what you call that) of smaller and smaller dimensions to represent each branch at the last minute. The source is definitely not production quality, but it works. If needed, I'm sure you could come up with a more concise solution. header file // Spring 2006 CS454 Project // (c) 2006 Lee Baker, Sage LaTorra, Brent Cramer unless noted // Primary Maintainer: Sage #pragma once #include "object_module.h" #include "simplex_noise.h" #define NUM_TREES 50000 #define NUM_BUSHES 10000 //TODO implement class tree_module : public object_module { public: tree_module(void); ~tree_module(void); void render(const params * const p); bool init(params * p); void deinit(); protected: vec3f trees[NUM_TREES][17]; float branchWidthTree[NUM_TREES][17]; int numberOfTrees[NUM_TREES]; vec3f bushes[NUM_TREES][17]; float branchWidthBush[NUM_TREES][17]; int numberOfBushes[NUM_TREES]; int treesMade; int bushesMade; void makeSegment(int depth,int MAXnodes,float Woffset,float a, float b, vec3f d, float alphaY,int BrNo,int BrNo1, float r1,float r2,float theta,float sigma,float gamma); void makeBushSegment(int depth,int MAXnodes,float Woffset,float a, float b, vec3f d, float alphaY,int BrNo,int BrNo1, float r1,float r2,float theta,float sigma,float gamma); void rotate (vec3f *root,int m, int n, float rx, float ry, float rz); void translate(vec3f *root,int i,vec3f d,int MAXnodes); void makeBushLeaf(float a, float b, float dx,float dy, float dz, float alphaY,int BrNo,int BrNo1, float r1,float r2,float theta,float sigma,float gamma); vector<vertexvn> verts; vector<vec3f> leaves; vector<vertexvn> leafverts; simplex_noise sn; simplex_noise sn_leaves; }; implementation file // Spring 2006 CS454 Project // (c) 2006 Lee Baker, Sage LaTorra, Brent Cramer unless noted // Primary Maintainer: Sage #include "global.h" #include "tree_module.h" #include <gl\gle.h> #include <stdlib.h> #include <time.h> #pragma comment(lib, "gle.lib") /* Based on an algorithim by Sergey and Alexander Vasilevskiy >From http://www.cs.mcgill.ca/~svasil/557/Report557.htm */ static float theta[] = {0, 70, 30, 30 }; static float sigma[] = {15, 15, 15, 15 }; static float gamma[] = {70, 70, 70, 70 }; static float Woffset[] = { 60, 30, 20, 15}; static float bushWoffset[] = { 40, 20, 15, 10}; tree_module::tree_module(void) { } tree_module::~tree_module(void) { //nothing to destruct } void tree_module::deinit() { leafverts.clear();//Clear out all saved information leaves.clear(); verts.clear(); } void tree_module::render(const params * const p)//Renderer function: draws everything { if(verts.empty()) return; glColor3f(1,1,1); sn.enable(p->time);//Start shader glEnable(GL_VERTEX_ARRAY);//Set up array glEnable(GL_TEXTURE_COORD_ARRAY); glEnable(GL_NORMAL_ARRAY); glVertexPointer(3, GL_FLOAT, sizeof(verts[0]), &verts[0].point); glNormalPointer(GL_FLOAT, sizeof(verts[0]), &verts[0].n); //Next line draws all segments of branches from bushes AND trees glDrawArrays(GL_QUADS, 0, verts.size());//Draw all points from the array using one handy call sn.disable();//Turn off shader glColor4f(.2, .9, .7, 1); sn_leaves.enable(p->time);//Turn on leaf shader glVertexPointer(3, GL_FLOAT, sizeof(vertexvn), &(leafverts[0].point)); glNormalPointer(GL_FLOAT, sizeof(vertexvn), &(leafverts[0].n)); glDrawArrays(GL_TRIANGLES, 0, leafverts.size()); sn_leaves.disable(); } bool tree_module::init(params * p) { int i, k, j,m,n,q,r; float h,tempx,tempz; k=0; srand( (unsigned)time( NULL ) ); treesMade = 0; bushesMade = 0; sn_leaves.init(1024, "leaves.vert", "leaves.frag"); for( list < vector <vec2i > * > ::const_iterator i = p->streams.begin(); i != p->streams.end(); i++) for(vector <vec2i>::const_iterator j = (*i)->begin(); j != (*i)->end(); j++)//For now, use the function for locating streams { m = j->x +5+(int)(10*((float)rand()/RAND_MAX));//Move some random distance from existing streams n = j->y +5+(int)(10*((float)rand()/RAND_MAX)); if(m >= p->world_dim.y){//Bounds check m = p->world_dim.y-1; } if(n >= p->world_dim.x){ n = p->world_dim.x-1; } h = p->world_heightmap[m][n];//Get the height for the location tempx = (float)m;//Convert to float tempz = (float)n; if(k==0){//Only draw trees at every 60th vertext of streams if(h < p->water_h){//Make sure they're above the water table continue; } if(p->collider.check(vec3f(tempx, h + 5, tempz), 5.0)) continue;//If there's a collison, skip this location else p->collider.add(vec3f(tempx, h + 5, tempz), 5.0);//Add to the list of collidable objects if(treesMade < NUM_TREES){//Don't make too many theta[1]=70+(h/7);//Vary parameters based on height theta[2]=30+(h/7); theta[3]=30+(h/7); sigma[0]=15+(h/7); sigma[1]=15+(h/7); sigma[2]=15+(h/7); sigma[3]=15+(h/7); makeSegment(1,10,120.0,10.0,0.0,vec3f(tempx,h,tempz),0,1,1,0.35,0.1,theta[0],sigma[0],gamma[0]); } k++; }else if(k == 30){ //Draw a bush instead if(h < p->water_h){//Make sure we're above water continue; } if(p->collider.check(vec3f(tempx, h + 2, tempz), 3)) continue;//Collison check else p->collider.add(vec3f(tempx, h + 2, tempz), 3); if(treesMade < NUM_TREES){ theta[1]=40+(h/7);//Vary for height theta[2]=20+(h/7); theta[3]=20+(h/7); sigma[0]=15+(h/7); sigma[1]=15+(h/7); sigma[2]=15+(h/7); sigma[3]=15+(h/7); makeBushSegment(1,10,10.0,10.0,0.0,vec3f(tempx,h,tempz),0,1,1,0.275,0.05,theta[0],sigma[0],gamma[0]); } k++; }else if(k == 60){ k = 0; }else{ k++; } } for(size_t i = 0; i < treesMade; i++) { for(size_t j = 1; j < numberOfTrees -2; j++)//this loop adds all trees to the list of vertices to be drawn { vec3f p0(trees[j]); vec3f p1(trees[j+1]); vec3f l = p1 - p0; l.normalize(); vec3f ref = (dot(up, l) > 0.8) ? vec3f(1,1,1) : up; vec3f vtop0 = cross(l, ref); vtop0.normalize(); vec3f vtop1 = cross(vtop0, l); vec3f vbottom1 = vtop1 * branchWidthTree[j+1]; vec3f vbottom0 = vtop0 * branchWidthTree[j+1]; vtop1 = vtop1 * branchWidthTree[j]; vtop0 = vtop0 * branchWidthTree[j]; vec3f n[4] = { normalize(vtop1), normalize(vtop1), normalize(vbottom0), normalize(vbottom1) }; //set up vertices //todo later //add to be rendered (2 of each above, ie one per poly) verts.push_back(vertexvn(p0 + vtop0, n[0])); verts.push_back(vertexvn(p0 + vtop1, n[1])); verts.push_back(vertexvn(p1 + vbottom1, n[3])); verts.push_back(vertexvn(p1 + vbottom0, n[2])); verts.push_back(vertexvn(p0 - vtop0, -n[0])); verts.push_back(vertexvn(p0 + vtop1, n[1])); verts.push_back(vertexvn(p1 + vbottom1, n[3])); verts.push_back(vertexvn(p1 - vbottom0, -n[2])); verts.push_back(vertexvn(p0 - vtop0, -n[0])); verts.push_back(vertexvn(p0 - vtop1, -n[1])); verts.push_back(vertexvn(p1 - vbottom1, -n[3])); verts.push_back(vertexvn(p1 - vbottom0, -n[2])); verts.push_back(vertexvn(p0 + vtop0, n[0])); verts.push_back(vertexvn(p0 - vtop1, -n[1])); verts.push_back(vertexvn(p1 - vbottom1, -n[3])); verts.push_back(vertexvn(p1 + vbottom0, n[2])); } } for(size_t i = 0; i < bushesMade; i++) { for(size_t j = 1; j < numberOfBushes -1; j++)//Add all bushes, similar to trees above { vec3f p0(bushes[j]); vec3f p1(bushes[j+1]); vec3f l = p1 - p0; l.normalize(); vec3f ref = (dot(up, l) > 0.8) ? vec3f(1,1,1) : up; vec3f v0 = cross(l, ref); v0.normalize(); vec3f v1 = cross(v0, l); vec3f v3 = v1 * branchWidthBush[j+1]; vec3f v2 = v0 * branchWidthBush[j+1]; v0 = v0 * branchWidthBush[j]; v1 = v1 * branchWidthBush[j]; vec3f n[] = { normalize(v0), normalize(v1), normalize(v2), normalize(v3) }; verts.push_back(vertexvn(p0 + v0, n[0])); verts.push_back(vertexvn(p0 + v1, n[1])); verts.push_back(vertexvn(p1 + v3, n[3])); verts.push_back(vertexvn(p1 + v2, n[2])); verts.push_back(vertexvn(p0 - v0, -n[0])); verts.push_back(vertexvn(p0 + v1, n[1])); verts.push_back(vertexvn(p1 + v3, n[3])); verts.push_back(vertexvn(p1 - v2, -n[2])); verts.push_back(vertexvn(p0 - v0, -n[0])); verts.push_back(vertexvn(p0 - v1, -n[1])); verts.push_back(vertexvn(p1 - v3, -n[3])); verts.push_back(vertexvn(p1 - v2, -n[2])); verts.push_back(vertexvn(p0 + v0, n[0])); verts.push_back(vertexvn(p0 - v1, -n[1])); verts.push_back(vertexvn(p1 - v3, -n[3])); verts.push_back(vertexvn(p1 + v2, n[2])); } } sn.init(512, "trunk.vert", "trunk.frag");//Load shaders for(vector<vec3f>::const_iterator i = leaves.begin(); i != leaves.end(); i++)//This loop creates the actial leaf vertices, given a base point { vec3f n = cross(vec3f(0.5f, 0.5f, 1), vec3f(-0.5f, 0.5f, 1)); n.normalize(); leafverts.push_back(vertexvn(*i, n)); leafverts.push_back(vertexvn(*i + vec3f(0.5f, 0.5, 1), n)); leafverts.push_back(vertexvn(*i + vec3f(-0.5f, 0.5, 1), n)); n = cross(vec3f(-0.5f, 0.5f, -1), vec3f(0.5f, 0.5f, -1)); n.normalize(); leafverts.push_back(vertexvn(*i, n)); leafverts.push_back(vertexvn(*i + vec3f(0.5f, 0.5, -1), n)); leafverts.push_back(vertexvn(*i + vec3f(-0.5f, 0.5, -1), n)); n = cross(vec3f(1, 0.5, 0.5f), vec3f(1, 0.5, -0.5f)); n.normalize(); leafverts.push_back(vertexvn(*i, n)); leafverts.push_back(vertexvn(*i + vec3f(1, 0.5, 0.5f), n)); leafverts.push_back(vertexvn(*i + vec3f(1, 0.5, -0.5f), n)); n = cross(vec3f(-1, 0.5, 0.5f), vec3f(-1, 0.5, -0.5f)); n.normalize(); leafverts.push_back(vertexvn(*i, n)); leafverts.push_back(vertexvn(*i + vec3f(-1, 0.5, 0.5f), n)); leafverts.push_back(vertexvn(*i + vec3f(-1, 0.5, -0.5f), n)); } return true; } void tree_module::makeSegment(int depth,int MAXnodes,float rWoffset,float a, float b, vec3f d, float alphaY,int BrNo,int BrNo1, float r1,float r2,float rtheta,float rsigma,float rgamma) { int i,j,k,c=3; double delta; vec3f branch[17]; int depthOffset=0; if ((MAXnodes>0) && (treesMade < NUM_TREES))//Make sure there is a number to make, and that we have't made too many { MAXnodes = MAXnodes + 2;//Add extra nodes since the extruder won't draw the first or last node for(i=0;i<MAXnodes;i++) { branch = zero3f; } branch[2].y=rWoffset;//This is the hight of the main trunk area for (i=3;i<MAXnodes;i++) // deviation angle by a function of sigma and gamma { branch.x=branch[i-1].x+((a-(i-1)*b/MAXnodes)*sin((i-1)*rsigma/57.2958)*cos((i-1)*rgamma/57.2958)*((float)rand()/RAND_MAX)); branch.z=branch[i-1].z+((a-(i-1)*b/MAXnodes)*sin((i-1)*rsigma/57.2958)*sin((i-1)*rgamma/57.2958)*((float)rand()/RAND_MAX)); branch.y=((c*pow(i-1,1.2)))+branch[i-1].y+(((a-(i-1)*b/MAXnodes)*cos((i-1)*rsigma/57.2958))*((float)rand()/RAND_MAX)); } rotate(branch,0,MAXnodes,0,0,rtheta*((float)rand()/RAND_MAX));//Rotate all branches around z axis rotate(branch,0,MAXnodes,0,alphaY*((float)rand()/RAND_MAX),0);//Rotate all branches around y axis if (depth>2) {//Extra rotations for depth, used to move children branches away from parents rotate(branch,0,MAXnodes,0,0,theta[1]*((float)rand()/RAND_MAX)); rotate(branch,0,MAXnodes,0,gamma[1]*BrNo*((float)rand()/RAND_MAX),0); } if (depth>3) { rotate(branch,0,MAXnodes,0,0,theta[2]*((float)rand()/RAND_MAX)); rotate(branch,0,MAXnodes,0,gamma[1]*BrNo1*((float)rand()/RAND_MAX),0); } for(i=0;i<MAXnodes;i++) {//Scale down from the size branch=branch*0.025f; } branch[MAXnodes-1] = branch[MAXnodes - 2];//The least node chould duplicate the second to last, as it is only used for extrusion, which is not currently used translate(branch,0,d,MAXnodes);//Move to the proper location delta=(float)(r1-r2)/(MAXnodes-2);//Change in width between branch points numberOfTrees[treesMade] = MAXnodes;//Save the number of branches for(i=0;i<MAXnodes;i++) { //Optional file output //fprintf(outfile,"Branch %d (depth %d) point %d (of %d) is %lf, %lf, %lf\n", treesMade, depth, i, MAXnodes, branch.x, branch.y, branch.z); trees[treesMade] = branch; if(i == 0 ){//Store widths branchWidthTree[treesMade] = r1; }else if(i == MAXnodes-1){ branchWidthTree[treesMade] = branchWidthTree[treesMade][i-1];//The second to last node can have width equal to the last node, since it is only used for extrusion }else{ branchWidthTree[treesMade] = r1 - (delta*(i-1)); } } if(depth==4){//If we have a leaf, copy it in to the leaf array leaves.push_back(branch[MAXnodes-1]); } treesMade++;//We've made a tree, record it for(i=2;(i<MAXnodes) && (treesMade < NUM_TREES);i++)//Spawn children trees { if ((depth==1)) { makeSegment(depth+1,(MAXnodes-2)-i/2,Woffset[1],10.0,0.0,branch,gamma[1]*i,i,i,(r1-(r1-r2)*(i)/MAXnodes),0.07,theta[1],sigma[1],gamma[1]); } if ((depth==2)) { makeSegment(depth+1,(MAXnodes-2)-i/3,Woffset[2],10.0,0.0,branch,gamma[2]*i,BrNo,i,r1-(r1-r2)*(i)/MAXnodes,0.07,theta[2],sigma[2],gamma[2]); } if ((depth==3)) { makeSegment(depth+1,2,Woffset[3],10.0,0.0,branch,gamma[3]*i,BrNo,BrNo1,r1-(r1-r2)*(i)/MAXnodes,0.05,theta[3],sigma[3],gamma[3]); } } } } void tree_module::rotate (vec3f *root,int m, int n, float rx, float ry, float rz){ int i; float x,y,z; float PIe=3.14159265; for (i=m;i<n;i++) { //Rotate Around z axis x=root.x*cos(rz*PIe/180)-root.y*sin(rz*PIe/180); y=root.x*sin(rz*PIe/180)+root.y*cos(rz*PIe/180); root.x=x; root.y=y; //Rotate Around x axis y=root.y*cos(rx*PIe/180)-root.z*sin(rx*PIe/180); z=root.y*sin(rx*PIe/180)+root.z*cos(rx*PIe/180); root.y=y; root.z=z; //Rotate Around y axis x=root.x*cos(ry*PIe/180)+root.z*sin(ry*PIe/180); z=-root.x*sin(ry*PIe/180)+root.z*cos(ry*PIe/180); root.x=x; root.z=z; } } void tree_module::translate(vec3f *root,int i,vec3f d,int MAXnodes) { //Translate by dx, dy, dz int j; for (j=0;j<MAXnodes;j++) root[j]=root[j] + d; return; } void tree_module::makeBushSegment(int depth,int MAXnodes,float Woffset,float a, float b, vec3f d, float alphaY,int BrNo,int BrNo1, float r1,float r2,float rtheta,float rsigma,float rgamma) { int i,j,k,c=3; vec3f branch[15]; float delta; if ((MAXnodes>0) && (bushesMade < NUM_TREES)) { MAXnodes = MAXnodes + 2;//Add extra nodes since the extruder won't draw the first or last node for(i=0;i<MAXnodes;i++) { branch.x=0;branch.y=0;branch.z=0; } branch[2].y=Woffset;//Main truck growth for (i=3;i<MAXnodes;i++) // deviation angle by a function of sigma and gamma { branch.x=branch[i-1].x+((a-(i-1)*b/MAXnodes)*sin((i-1)*rsigma/57.2958)*cos((i-1)*rgamma/57.2958)*((float)rand()/RAND_MAX)); branch.z=branch[i-1].z+((a-(i-1)*b/MAXnodes)*sin((i-1)*rsigma/57.2958)*sin((i-1)*rgamma/57.2958)*((float)rand()/RAND_MAX)); branch.y=((c*pow(i-1,1.2)))+branch[i-1].y+(((a-(i-1)*b/MAXnodes)*cos((i-1)*rsigma/57.2958))*((float)rand()/RAND_MAX)); } rotate(branch,0,MAXnodes,0,0,rtheta*((float)rand()/RAND_MAX));//Rotate around z rotate(branch,0,MAXnodes,0,alphaY*((float)rand()/RAND_MAX),0);//Rotate around y if (depth>2) {//Rotation for child branches rotate(branch,0,MAXnodes,0,0,theta[1]*((float)rand()/RAND_MAX)); rotate(branch,0,MAXnodes,0,gamma[0]*BrNo*((float)rand()/RAND_MAX),0); } if (depth>3) { rotate(branch,0,MAXnodes,0,0,theta[2]*((float)rand()/RAND_MAX)); rotate(branch,0,MAXnodes,0,gamma[1]*BrNo1*((float)rand()/RAND_MAX),0); } for(i=0;i<MAXnodes;i++) {//Scale bushes smaller then trees branch=branch*0.0125f; } translate(branch,0,d,MAXnodes);//Move to proper locations delta=(float)(r1-r2)/(MAXnodes-2); numberOfBushes[bushesMade] = MAXnodes; for(i=0;i<MAXnodes;i++) { bushes[bushesMade] = branch; if(i == 0 ){ branchWidthBush[bushesMade] = r1; }else if(i == MAXnodes){ branchWidthBush[bushesMade] = branchWidthBush[bushesMade][i-1]; }else{ branchWidthBush[bushesMade] = r1 - (delta*(i-1)); } } if(depth==4){//If we have a leaf, copy it in to the leaf array leaves.push_back(branch[MAXnodes-1]); } bushesMade++;//We made a bush, yay! for(i=1;(i<MAXnodes) && (bushesMade < NUM_TREES);i++)//Spawn children. When a mommy branch loves a daddy branch very much... { if ((depth==1)) { makeBushSegment(depth+1,(MAXnodes-2)-i/2,bushWoffset[1],10.0,0.0,branch,gamma[1]*i,i,i,(r1-(r1-r2)*(i)/MAXnodes)*0.5,0.2,theta[1],sigma[1],gamma[1]); } if ((depth==2 && i > 3)) { makeBushSegment(depth+2,3,bushWoffset[3],10.0,0.0,branch,gamma[3]*i,BrNo,BrNo1,(r1-(r1-r2)*(i)/MAXnodes)*0.5,0.1,theta[3],sigma[3],gamma[3]); } } } } As for leaves, it seems like it really doesn't matter too much (from somewhat far away) what your leaves look like, as long as the tree is covered in some kind of green stuff that is attached to the end of the branches. We used something like a 4 leaf clover (always pointed up, 4 triangles) attached to the end of each branch in order to reduce our polygon count and because we were almost out of time, but I'm sure better looking solutions could be found quite quickly.
  8. foreignkid

    Procedural terrain textureing

    Quote:Original post by Matt Aufderheide I doubt completely procedural shaders can look very realistic up close. ... but they cant generate real images, like leaves, grass, sticks, stones etc. ...may fail up close. You're absolutely right. This is a problem that I've been thinking about a bit lately. I don't have a solution now, but it seems like there really should be a way to procedurally generate more textury stuff like the stuff you mentioned above. I think that this may be doable, but will probably be too expensive to do in a shader. I think we're years and years away from being able to do a shader (without a texture base) that can do randomly placed leaf shapes (which is probably what you're looking for), but I think stuff like a hay texture, or sticks, or sand or other simple textures that are not quite so specificly shape based are actually doable, and are something that I'll look at in the future. Quote:Original post by Matt Aufderheide However, I would be interested in learning more about your approach, and if you have screenshots that would be cool to see! I'm at work right now, and won't be able to get to my stuff until at least this weekend, but I'd be glad to show you some of the stuff that I've come up with so far. [Edited by - foreignkid on July 20, 2006 12:59:54 PM]
  9. foreignkid

    Procedural terrain textureing

    My thoughts are kind of scattered now, I'll try to clean this up later. Quote:Original post by Lutz Basically, you use the slope, height and some density information (average amount of grass, rock, sand...) in each pixel to mix a final color. Each quantity can be perturbed by Perlin noise to generate a more natural look. One of my projects uses similar techniques, but uses modified smoothed simplex noise and perlin noise to generate procedural texturing for the landscapes. I don't actually use textures, however- everything in the engine uses procedural texturing, or coloring, or whatever you want to call it, that is 100% generated in the pixel and vertex shaders. This is quite expensive in terms of performance, and also has pretty high requirements (SM3 card), but is not intended to be distributed as a game or anything (its a research project). This method gives very good results. All data is generated from a random seed, as in Ysaneya's engine. I should probably point out that modifying the result of the noise function is an important part of getting good results. Applying a function to the output (producing a non-uniform noise distribution) is often necessary to create a realistic texture. I sometimes use 3 and 4 dimensional noise functions to generate texturing for dynamic elements of the environment, such as water or the sky. For instance, the clouds move, grow and shrink dynamically. I use a 4d function (x,y,z, time) to color the pixels on the surface of a sphere, and have obtained pretty good results. Using higher dimensional noise functions is sometimes more expensive (which is why I often use the better dimensionally-scaling Simplex noise rather than Perlin noise), but it also eliminates quite a bit of complication. For example, I don't have to worry about texture mapping a square texture onto a sphere for the sky- there is never a step that requires a 2 dimensional flat image. Often, I end up using several noise function calls in one shader to generate a texture, basically yielding a detail texture type of result. One advantage of this method is that the shader (with knowledge of how far away the camera is) can adjust whether or not the detail-texturish noise function is actually evaluated, yielding a kind of LOD-ish thing (I haven't actually implemented this part yet, though I hope to soon). Another way to achieve a similar result would be to parameterize the number of octaves of noise calculated. Hope this gives you a few ideas about texture generation.
  10. This looks really good. Runs ~24fps on Mobility X1400. The shape never seems to completely shift (I'm not sure if it is actually supposed to); other than that, it looks cool.
  11. foreignkid

    Am I reading dell's website wrong?

    Quote:Original post by SticksandStones Quote:Original post by gumpy macdrunken weird. got a link or the specific model? I'm looking at the E1505 I know this isn't a thread about the laptop but... I highly recommend the E1505... I got mine last week, Core Duo, 1gb ram, X1400, WSXGA+ screen, all that for 970.. and I'm pretty happy with it. Back to the power adapter- It gets hotter than any piece of consumer electronics I've ever had- to the point of not being able to pick it up. Other than that, the machine is great- I can get about 5.3 hours battery life programming, or 7 hours typing on one battery.
  12. Friend of mine who is doing a graduate EE degree at UNM showed me one of his assingments the other day in which he had to design a processor on an FPGA that only calculated sine and cosine of a 16 bit fixed point input. It was really interesting- he did two versions of it, one that took 16 cycles (like ripple adder style), and one that calculated sin and cos in a single cycle. I looked at how he did the 16 cycle thing, and it was a kind of successive approximation thing that worked out way better than I had ever expected. Anyway, after seeing how easy this assignment looked, I'm sure that ATI and nVidia are capable of doing it on their modern cards. I don't have a transistor count for my friend's stuff, but it didnt look like it would be that high, and I figure would be likely to be included as it would definitely make a lot of shaders run faster.
  13. foreignkid

    pretty #define in DX10

    This place has some good function names, both long and funny
  14. foreignkid

    iPod Vending Machine

    I ran into one of these about a month ago at the StarTrek experience in LV, NV: link to pic i took
  15. VBOs really aren't very hard if you already have stuff setup for glDrawArrays or glDrawElements. I really encourage you to go that route. Good luck with whatever you do.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!