3D Sphere Phong Specularity

Fertiggestellt Veröffentlicht May 25, 2015 Bezahlt bei Lieferung
Fertiggestellt 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.

3D Rendering C Programmierung Softwarearchitektur

Projekt-ID: #7737495

Über das Projekt

2 Vorschläge Remote Projekt Aktiv May 25, 2015

Vergeben an:

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 Mehr

$20 USD in 1 Tag
(8 Bewertungen)
4.0

2 Freelancer bieten im Durchschnitt $66 für diesen Job

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 in 5 Tagen
(0 Bewertungen)
0.0