3D Sphere Phong Specularity

Dokončeno Zveřejněno May 25, 2015 K zaplacení v momentě doručení
Dokončeno K zaplacení v momentě doručení

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.

3D ztvárnění Programování v C Softwarová architektura

Identifikační číslo projektu: #7737495

O projektu

2 nabídek Projekt na dálku Aktivní May 25, 2015

Uděleno uživateli:

smittynpro

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 Další

$20 USD za 1 den
(8 recenzí)
4.0

2 Freelnceři na tento projekt zveřejňují nabídky v průměru $66

samsol84

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.

$111 USD za 5 dní
(0 Recenzí)
0.0