PDA

View Full Version : OpenGl 3D Room

Torrtuga
04-27-2015, 01:25 PM
I am learning openGl and know the basic concepts of 3D in it.
But I could not figure how to create a room of this type which I saw in many Projects.
The walls converge in the end with ceiling and floor.

How can we write this in openGl?

1765

04-27-2015, 07:35 PM
I am learning openGl and know the basic concepts of 3D in it.
But I could not figure how to create a room of this type which I saw in many Projects.
The walls converge in the end with ceiling and floor.

How can we write this in openGl?
1765
glVertex3f(x1,y1,z1,h);
...
glEnd();
to draw 6 or 5 plane to construct the room.
you can also use in way of index.

Torrtuga
04-27-2015, 09:54 PM
Do we have to make a cube and change the camera position?

04-28-2015, 01:32 AM
Do we have to make a cube and change the camera position?
Cube is a solid object, but room is a space feature. thus, need not to produce a cube.
To move or not the camera position denpends on which you will watch.

Torrtuga
04-28-2015, 02:17 AM
Then how can we create a 3D room in openGL?

04-28-2015, 04:36 AM

Torrtuga
04-28-2015, 05:51 AM
This site is useless. Of no help ever.

IonutCava
04-28-2015, 06:19 AM
draw 6 or 5 plane to construct the room..
... is a perfectly valid answer.

This site is useless. Of no help ever.
What are you having difficulties with?
Drawing the planes and positioning them?

daniel2k
04-28-2015, 10:58 AM
Just a pointer if that helps. The room is just a cube with it's normals inverted facing towards the inside.
If you get that far you just place the camera on the one side so you are viewing the inside of the cube.
The rest in the photo you provided is done by lighting, it seems they are using some advanced rendering like ray tracing

here is a link to get started with a cube
http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_05

IonutCava
04-28-2015, 11:16 AM
I initially missed his other post where he attempted exactly what you described: