Archived

This topic is now archived and is closed to further replies.

How do you make a room

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
id say the easiest way is make it in a 3d modelling program such as 3d studio max or maya.

learn how to load and draw the 3d model

Share this post


Link to post
Share on other sites
The easiest way:
1) create a bigger cube than before.
2) add the texture coordinate .
3) change the camera position into the cube.
4) change CULLMODE by use code:
SetRenderState(D3DRS_CULLMODE,D3DCULL_CW)[/CODE]
5) render it.

PS:
D3DCULL_NONE
Do not cull back faces.
D3DCULL_CW
Cull back faces with clockwise vertices.
D3DCULL_CCW
Cull back faces with counterclockwise vertices.

GOOD LUCK

Share this post


Link to post
Share on other sites
The easiest way:
1) create a bigger cube than before.
2) add the texture coordinate .
3) change the camera position into the cube.
4) change CULLMODE by use code:
    
SetRenderState(D3DRS_CULLMODE,D3DCULL_CW)

5) render it.


PS:

D3DCULL_NONE
Do not cull back faces.
D3DCULL_CW
Cull back faces with clockwise vertices.
D3DCULL_CCW
Cull back faces with counterclockwise vertices.


GOOD LUCK



[edited by - F_O_X on June 5, 2003 2:19:36 AM]

Share this post


Link to post
Share on other sites
FOX, this is the second answer of you that amazes me.

Original poster, look into some 3d file format. Or perhaps some map format. What does culling have to do with anything?

www.gametutorials.com has some nice 3ds, ase, obj loading tutorials, they should be convertable to D3D.

Share this post


Link to post
Share on other sites
I think he means that by reversing the culling order, you can effectively ''flip'' the faces of the cube to face inwards. This is not a very good way, especially because all of the texture co-ordinates will be backwards.

I agree, some model format seems like the way to go.

Share this post


Link to post
Share on other sites
To aker_jus:
FAINT,Why not create SKYBOX by use VB?!

This is easier way than load mesh.And its basic theory of skybox.

"D3DCULL_CCW" also can work,only to RE-DEFINE the vertex.

Why I use "D3DCULL_CW" is in order to let Kingpinzs know what different between SKYBOX and CUBE.

[edited by - F_O_X on June 5, 2003 8:32:34 AM]

[edited by - F_O_X on June 5, 2003 8:34:12 AM]

Share this post


Link to post
Share on other sites
Fox, did you even read AP''s question, your response is irrelevant.

Besides using a modelling package and loading models, a simpler, but more tedious, method is manually defining the vertices. If you can draw a cube, inside the cube, define two coplanar quads inside that make a wall, leaving some space between them, to represent a door, and there you go.

- Andrew

Share this post


Link to post
Share on other sites
Try downloading Milkshape. It is a good graphical modeling tool. You can build walls, ceilings, floors, doors, etc. to get the "room" you want.

You can download export tools that let you export the output to the .x file format, which you can then load into a DirectX mesh object and render it.

Share this post


Link to post
Share on other sites
Foxes response wasn''t irrelevant. It would probably work; it''s just not a very good way to do it. The most significant reason is that it just doesn''t scale when you start adding more rooms or more detail to a given room. I think the switching of cull-modes would also get extremely confusing. In order to get any kind of performance, you''ll also need to think about frustum culling objects/rooms outside the view of the camera.

I agree with the other recommendations. Look into one of the common indoor modeling formats like quake''s BSP maps. There''s lots of loaders out there with source. You may have a hard time finding a Direct3d version, but it''s not hard to port from OpenGL.

bpopp (bpopp.net)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
foxes response IS irrelevant

the original poster asked about creating two rooms and joining them together

and fox starts talking about skyboxes

how is a skybox two rooms joining together?


How would you cut a hole in the side of the cube was basically what was being asked

Share this post


Link to post
Share on other sites
Not to nitpick, but he did ask how to make a room *or* two rooms connected together. Two inside-out cubes (which is essentially a skybox) with an alpha masked door texture in one would allow you to give the appearance of two joined rooms. The exterior of the second cube would be culled from the outside so you could view it''s interior from the first cube through the alphamasked doorway. Again, definitely not the way to go, but it would probably work as long as you weren''t worried about collision detection, frustum culling, etc.

Share this post


Link to post
Share on other sites
This is what I under stand.

Choice 1) make a big cube and put the camera inside the cube.

So then how to I combine big cubes together to make more then one room?

Also the cube faces need to be facing inward. Then texture the polygons.

Choice 2) draw and load a 3d model

Is there any other way to make a room?
how do I put objects inside a box?



Share this post


Link to post
Share on other sites
King, sounds like you need to work through some very basic tutorials on rendering objects, positioning the camera, etc. Something like "putting objects in a box" is all a matter of scaling and positioning meshes, specifying vertices and normals to get the textures where you need them to be, and positioning the camera. Making a "door" involves creating a mesh that is the shape you want, either with a 3D editor or by specifying vertices by hand.

These are all basic concepts. Search this site and others for beginner''s tutorials. I used Andy Pike a long time ago (www.andypike.com, I think), and he had a good tutorial on setting up DirectX, drawing and lighting boxes, rotating them, etc.

Once you have the basics of creating and rendering meshes down, you will know how to create the room you want.

Share this post


Link to post
Share on other sites
So i just put a meash inside another to add objects.

So lets see here. First I make a skybox, make a terrain, put in cubes inside out and add meashes to the inside and out side the box then I put in object meashes then texture them.

That makes sence.

Thanks for the help

Share this post


Link to post
Share on other sites
Nonono.. forget choice 1. It''s not a choice. I was just defending fox in saying that it COULD be done. It''s probably not a viable solution for what you want.

Do a search on Google for "BSP Tutorial" and you should find more than enough information to get you started.

Share this post


Link to post
Share on other sites