3D Framework - scene with sphere! As detailed as needed.

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Byteraver
Posts: 60
Joined: May 19th, 2016, 6:48 am
Location: Belgium, Europe

3D Framework - scene with sphere! As detailed as needed.

Post by Byteraver » March 19th, 2017, 10:37 pm

Hi everybody, in order to learn to understand Chili's 3D Framework I added a scene with a sphere (the first scene actually so I didn't have to hit the tab button each time :mrgreen: ). You can choose how many "slices" the sphere is made of in each direction (from 0 .. 2 PI and from top .. bottom), just change the values at the top of sphere.h:

Code: Select all

    static const int NrHSlices = 20;
    static const int NrVSlices = 16; // top & bottom disc included
I thought you might like it. I'm sorry for the messy colors, ran out of time to fix that. But you get the idea ;)
I should've posted this as a separate branch on github but I couldn't be bothered to figure out how to do that.
I'm afraid I had to make a default constructor for your IndexedTriangleList Chili, sorry ;)
Attachments
sphere.png
sphere.png (27.21 KiB) Viewed 1492 times
3DFrameWork.rar
(239.53 KiB) Downloaded 105 times

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: 3D Framework - scene with sphere! As detailed as needed.

Post by chili » March 20th, 2017, 3:45 am

Hey that looks good man! Well, I mean the color scheme is a little pukey, but the sphere looks good :)

I'm gonna be using a sphere when we get to gouraud shading in the future.
Chili

Byteraver
Posts: 60
Joined: May 19th, 2016, 6:48 am
Location: Belgium, Europe

Re: 3D Framework - scene with sphere! As detailed as needed.

Post by Byteraver » March 20th, 2017, 7:23 am

Will you go directly to Gouraud shading or start with Larousse shading, then Gouraud, then Phong shading? Can't wait to see the tutorials! I kind of know how they work but implementing them is another matter of course.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: 3D Framework - scene with sphere! As detailed as needed.

Post by chili » March 20th, 2017, 7:54 am

It'll be flat shading -> Gouraud (per vertex) -> phong (per pixel) and then ill talk about specular and finally normal maps.
Chili

Post Reply