letting user dynamically create their own environment in directX

fguihen

Junior Contributor
Joined
Nov 10, 2003
Messages
248
Location
Eire
how would i , using directX and c#, create an app that allows a user to create a simple ed envrionment. it would basically entail the user using a mouse to click on a point on my forum, and drag out the required size of a rectangle they want. i dont know if its too difficult but i just dont know where to start.
 
You mean a modeling environment? Or a GUI type of thing involving windows and boxes?

This might be hard to make, you would technically have to code it all by scratch. ;)
 
Aragorn7 said:
You mean a modeling environment? Or a GUI type of thing involving windows and boxes?

This might be hard to make, you would technically have to code it all by scratch. ;)


i mean allowing th e user to model the envrionment by dragging out the size of a rectangle they want, like th eway you make a rectangle in paint, but the object would be a 3d object so it would need height also, as im using directX
 
What are you going to make? Mapeditor, model-editor?? Well.. I'm no guru at this and i've actually never tried, but i have thought about it as i later will need a mapeditor... I'd do it like this:

Three (or more) views on the screen, One looking towards the front of the object (Y, X), one from the side (X, Z), one from the top (X, Y), and maybe a view with it all textured (shaded, whatever... just to see the results..). Here using (Y, X) means that you should use the Y axis as the X axis and X axis as the Y axis...

The three first views will be the areas you drag the rectangle. When dragging the rectangle, you take the "position of the view" and add the mouse X,Y coordinates to get the "real position" inside that view. Then you must create the needed vertices (one with x,y,z where you clicked in the view, one with x + mouseX, y, z one with x,y + mouseY,z and one with x+mouseX, Y+MouseY, z). If you have to set the X, Y or the Z varies from what view the user uses... then just do this with all the sides of the rectangle (3D right??)...

As i said i have never tried this, so try it at own risk MWAHAHAH!!! ok, ok, i will relax , have some sleep and drink something with relaxing effect, like red bull :p

EDIT: if its hard to understand (for some reason my english get the oposite of tidy, when i explaind difficult things :P), just post the part you didn't understand and i'll try to explain better..

-- Loffen
 
Last edited:
Here's a couple tips:
Read up on SwapChains to get different views at the same time (there's some info on www.robydx.altervista.org).
You're (obviously) going to have to do a lot of real time stuff, so scripts may be needed.
Look into HLSL and .fx files... possibly you could create your own scrips using these..

I've never attempted this :), so I'm not sure

-The Pentium Guy
 
fguihen said:
i mean allowing th e user to model the envrionment by dragging out the size of a rectangle they want, like th eway you make a rectangle in paint, but the object would be a 3d object so it would need height also, as im using directX
Ok, so basically 3DS max without the expense? That will take a long time, but it might be an interesting project. I can barely help you....because I only recently have been working with DX9c. I made the jump from DirectX7.
 
well my exact idea, is that im making a crowd simulation program, in 3d using direct X. i want to allow the user to be able to drag obstacles onto the screen, and see how the crowd react to it if its in their path. theese obstacles will be simple rectangles, and the user can use them to create walls, or just plain obstacles. its all going to be done with 3d rectangles. i hope you understand what im saying, as im having difficulty explaining it
 
fguihen said:
well my exact idea, is that im making a crowd simulation program, in 3d using direct X. i want to allow the user to be able to drag obstacles onto the screen, and see how the crowd react to it if its in their path. theese obstacles will be simple rectangles, and the user can use them to create walls, or just plain obstacles. its all going to be done with 3d rectangles. i hope you understand what im saying, as im having difficulty explaining it
Yes, this makes sense....You are going to have to set up geometry that is pretty basic, and then be able to change that while running. I would start out by getting a simple engine that can draw walls and other 3D objects. Then start designing the UI around that, by implimenting DirectInput.
 
Aragorn7 said:
Yes, this makes sense....You are going to have to set up geometry that is pretty basic, and then be able to change that while running. I would start out by getting a simple engine that can draw walls and other 3D objects. Then start designing the UI around that, by implimenting DirectInput.


what would i need directInput for?? to take in input from the mouse while th program is running ( i.e in realtime)?
 
fguihen said:
what would i need directInput for?? to take in input from the mouse while th program is running ( i.e in realtime)?
Yes, I suppose so....I hate windows mouse input, or is that keyboard input? Windows mouse input isn't half bad, but the keyboard input should be made using Direct Input.
 
Back
Top