How do i create a room?

Started by
6 comments, last by Zakwayda 12 years, 10 months ago
Hi,

how do i go about creating a room, that i can be in and move around in,

surely its not as simple as creating a big hollow cube, want i want to make is something like



obviously without the shadows and textures, that can come later, purely flat solid colors for now

so yeah how do i start this do i need 4 walls and then to place the camera inside them. If this is the case whats actually moving when i turn, is it the walls or is it me?

thanks.
Advertisement

If this is the case whats actually moving when i turn, is it the walls or is it me?

It depends on how you look at it. Ultimately it all reduces (in one form or another) to a single transform that's applied to all geometry to be rendered, but as far as the actual simulation goes, you'll generally move the camera and not the static objects. (It all ends up in clip space ultimately, but for purposes of managing the simulation it can be helpful to think of the camera as an object moving through a static scene.)


What windowing/input API will you be using?
thanks,

it will be created using openGL with LWJGL,

so far all i have done, as part of a uni assignment is create a model viewer with phong shading.

:)
LWJGL makes it quite easy to set up a window and poll for input, so that part shouldn't be too much of a problem.

If you need further help, you might want to post back with some more specific questions; even a simple application like the one you describe has quite a few aspects to it, so we'll probably be able to help more effectively if you can narrow down your question(s) a bit.
hi,

the polling part is done, so i have the potential to read from the key board, so i guess more specifically how do i create a room in the most efficient way?

one idea

is to create a huge cube and then place the camera and a light source within the cube, with the inside cube faces being illuminated from the inside light source.

the other idea

is like a cube i suppose, but with all walls being interdependently created (i lol to my self, as a write this, since it just seems the same as the first idea)

realistically though i think what i don't understand is the whole idea of being inside something, so far all i have modeled is a tea pot and such where i'm looking at something rather than being on the inside,

how would you go about creating a room?
Rather than thinking of 'inside' and 'outside', just think in terms of polygons/triangles.

OpenGL doesn't have any concept of 'inside' or 'outside'. What OpenGL is concerned with is polygons and triangles (ultimately just triangles), and which of the two sides of the triangle is/are visible.

Typically, you'll set things up so that only one side of each triangle is visible (although two-sided primitives are sometimes used for special effects). A cube that's intended to be a room really isn't any different than a cube that's intended to be, say, a die, other than the fact that the triangles 'point' inward rather than outward.

At its simplest, a room can just consist of 6 quads (12 triangles), oriented so that they're visible from the inside of the volume rather than the outside.
thanks, this actually makes sense to me, i suppose the best way to tackle it would be

to create a large polygon dead ahead of the viewer, with a light source in between the two.
with that done add in the other surrounding walls.

the next thing to grasp is the movement,

for instance if i have a polygon far off in the distance its pretty small, if i want the polygon to appear larger does,
it have have to move to me or do i have to move to it?

thanks for the help :)

for instance if i have a polygon far off in the distance its pretty small, if i want the polygon to appear larger does,
it have have to move to me or do i have to move to it?

As mentioned earlier it all pretty much reduces to the same thing as far as OpenGL is concerned, but practically speaking, you'd typically move the camera and let the static objects remain static. (What this usually involves is moving the camera object, constructing a transform representing the camera object's current position and orientation, and then inverting that transform for use as the view transform.)

This topic is closed to new replies.

Advertisement