Build a Wall in OPENGL

Started by
7 comments, last by haphazardlynamed 17 years ago
Hi, Right now i am doing an assignment which is asking me to build a house with a house with 2 rooms connected by a hallway. We should use polygon meshes. In the specs they have given that Each of us will be allocated with a different shaped rooms, so for example we may be told to use a room with 10 sides at one end and an 8 sided room at the other end of the connecting hallway. So they have given me that Room 1 has 8 vertices and the radius is 20 and the room 2 has 17 vertices and 11 radius. Th enumber of vertices equals the number of sides. And also they have provide me with the hieigh of the roof and the walls. How can i build a room which has so many sides? And what do this vertices and radius means... Sorry i am not so good @ this stuff, i am totally a system guy..Only for assignment pupose i do programming. It would be really great if anybody can help me on this. Thanks Hari
Advertisement
The general policy is no homework... but seeing as how this is such a 'common knowlege' fact, I'll point out that:

the 8-sided room is an Octagon
http://en.wikipedia.org/wiki/Octagon

the 17-sided room is a HeptaDecagon
http://en.wikipedia.org/wiki/Heptadecagon


Both of those links show what the shapes of each room should look like.
Hi,

THanks for the reply.

Atleast now i know how to start of this. Is there a sample program or something i can have , so that i can start coding. I have went through some lessons in nehe website(until 8) . But is there a way i can auto generate the wall instead of calculating the vertices one by one? Something like a loop?

Thanks
Hari
Also the link you provide me will be the shape of the Floo of the rooms right? Based on that i need to build the sides and roof of the room?

Thansk
Hari
Quote:Original post by sri_hari1986
is there a way i can auto generate the wall instead of calculating the vertices one by one? Something like a loop?


http://en.wikipedia.org/wiki/Unit_circle

*This response is intentionally vague due to the nature of homework.





I'm kinda curious what kind of assignment this could be...
Seems to be an odd mix of basic geometry/trigonometry but there seems to be opengl in the mix... generally you don't take a class with opengl without the trig as some prerequisite...
A very odd class it seems...
I am going nuts with this subject. Because i totally know nothing about programming and i have been given an assignment in that. Let me ask my teacher whether i can drop this subject and take some other elective.

Thanks for your help.

Regards
Hari
"i totally know nothing about programming"

At least you are able to admit it, unlike others who just ask people to write the source code for them.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
This is actually a elective subject, i thaught i would try to do this just to get a feel in doing programming stuff...But after attending the classes i taught to drop the project...Because this subject is not for me..
Generally you'd want to already know how to program before trying to program for 3d graphics.

Why not try and find an introductory programmaing elective instead, then save this one for next year?

This topic is closed to new replies.

Advertisement