3D Sphere Phong Specularity
$10 USD
Bezahlt bei Lieferung
Hello;
This is a very simple project for anyone with a clear understanding of 3D rendering / raytracing. I'm posting this project is simply to further my understanding of how raytracing works.
The following code shades a 3D sphere:
for (y=0;y<screenHeight;y++)
for (x=0;x<screenWidth;x++)
if (sqr((x-xcenter)*(x-xcenter)+(y-ycenter)*(y-ycenter))<radius)
{
vx=(x-xcenter);
vy=(y-xcenter);
vz=sqr(radius*radius-vx*vx-vy*vy);
vl=sqr(vx*vx+vy*vy+vz*vz);
co_angle=(lx*vx+ly*vy+lz*vz)/(ll*vl);
pixel=co_angle*255;
}
lx,ly,lz are light location. x&y center are simply screen center location for the sphere. ll is light length: ll=sqr(lx*lx+ly*ly+lz*lz);
I would like someone to implement specular lighting (shinyness) based on this code. The specular lighting should have the basic features which are intensity, shinyness and color. Ideally, the project could be completed by simply expanding on this code and resubmitting it back to me.
Any questions, feel free to ask.
Attached is an image showcasing the results I'm looking for.
Projekt-ID: #7737495
Über das Projekt
Vergeben an:
Hello I'm a computer scientists with high experience in data structures and design of algorithms. My specialization is computer graphics working everyday using C/C++, Opengl and shaders. You can check my skills in my l Mehr
2 Freelancer bieten im Durchschnitt $66 für diesen Job
Hi.. I am interested in your project. Let me know for which platform, do you want it? I prefer to implement in webgl/canvas using html5 . It will be cross platform and easy to understand. Thank you.