Well, i'm looking for a good guide to program Topdown 3D in C++. Where i can find a good one?
Thanks.
Topdown isn't any different than any other 3D programming - except for the position of the viewer.
You can get some more information about what you want to do by checking out gluLookAt()
Your "up" would be X or Z depending on what you wanted to do and if you still wanted to use right-handed coordinates for everything else.
Check out Isometric at the nehe tutorials site.
Related
I'm new in direct3d and i got a newbie question.
I got a point in the world and the location of the camera. I would like to know where i will see the point on my screen. I know the width/height of my screen, the field of view of the camera and everything else. I think that there will be function that do that and i don't need to calculate my self.
I searched a lot and couldn't find it, how do i do that?
The only thing i found is: http://msdn.microsoft.com/en-us/library/bb205516%28VS.85%29.aspx but i didn't understand what to give to him (im new in direct3d as i said)
Thank you for your help
First of all, Direct3D is not a solution to world to screen transformation, it is an API that lets you use the GPU to solve that problem faster on the GPU, but if you don't know, how to do it without Direct3D, then Direct3D will probably of no help. So you have to learn the linear Algebra, and the Rendering Pipeline (which is already documented in a lot of places).
I'm wondering if anyone could point me to any resources that would deal in rotating one or several 2D textured planes in 3D space. Something like this but with openGL (preferably C++):
I'm attempting to do pretty much the exact same thing but no matter how I order my operations I'm getting right-screwy results. So I figure asking for some resources on the subject is better than posting tons of code and asking for people to fix my problems for me. :)
If you havent already, do a search for 'NeHe tutorials'. An excellent set of OpenGL tutorials.
Here is a link to the rotation tutorial, includes all the source code in downloadable format and the tutorial walks you through each relevant line.
http://nehe.gamedev.net/tutorial/rotation/14001/
I believe this is working in a 2D space, the step up to 3D probably involves a bit more matrix math but...doable
The NeHe tutorials are a very popular place to learn the basics of OpenGL. In particular, the tutorial about texture mapping should help you:
http://nehe.gamedev.net/tutorial/texture_mapping/12038/
Mind you though that these tutorials are written for older OpenGL versions which are more beginner friendly IMHO.
You should look into scene graphs. Basically it is a way to define a bunch of objects (2D textured planes) and their transforms in 3D space. This allows you to define transforms that work on multiple nodes (objects) as well as single nodes. You can make a pretty simple one in C++ with little effort, or use one such as OpenSG or OSG (slight learning curve needed).
Wikipedia - http://en.wikipedia.org/wiki/Scene_graph
I need to graph XYZ coordinates in a 3D cube that I can rotate. Im look for code that will basically take a 3d array of 1s and 0s and build a cube. Coloring of the points would also be nice. The program that creates the point is in C/C++ so I would prefer something that would play nicely will that but Im not picky. Im alright aware that Mathematica can do this , but Im looking for something that can be "live" updated so I can watch the progress
Thanks in advance
One obvious possibility would be something like Direct3D (for Windows, X-box and Windows Phone 7) or OpenGL (for pretty much anything that can do 3D except X-box or Windows Phone 7).
There are quite a few libraries and sample code for things like this.
If you're working on Unix/Linux, you may or may not have OpenGL installed. If you don't, you might want to check into Mesa3D.
I would go with Jerry's suggestion of using OpenGL. There are some good tutorials out there too - have a look at the nehe series which have examples for doing precisely what you're after.
Refer this tutorial link : http://www.directxtutorial.com/
This will help you to implement three dimensional cube.
so im arguing with my friend about GetWorldTransform(). im saying that this DEVICE->GetTransform(D3DTS_WORLD, &matWorld); is the same as GetWorldTransform() in gdi+.
am i right or wrong? if im wrong what is it than in directx?
Yeah you are definitely wrong. The GDI+ world transform is very simple and only allows transformations in 2D. Checkout the XFORM structure to see how different it is to a Direct 3D matrix. Its not even homogeneous. The 2 "may" end up going to the same hardware functionality but there is no guarantee of this. GDI+ is quite a high level wrapper where Direct3D is much closer to the metal. The 2 really aren't comparable.
Well, AFAIK GDI+ is 2D and DirectX is 3D. so they are not equal in that matter, and continuing on that, there wouldn't be a match either.
So according to me:
am i right or wrong?
You are wrong.
if im wrong what is it than in directx?
There is no equivalent.
Does anyone know of a graphing library for simple transformation of a point from one coordinate system to another coordinate system which is rotated by a angle and some point transformation and just for 2d?
And any graphing tool for plotting and verifying the same visually?
double[3][3]
GDAL includes pretty much every graphic transform you could ask for, and while it is big and hence takes some time to get used to, it is a great framework to move forward with.
This isn't a library, but it's a blog by someone who does this kind of thing:
http://polymathprogrammer.com/
It's got some good theory if you want to know the "behind the scenes".
The Angtigrain Geometry library contains code that can do this, and you can also go farther and use it for drawing as well, but you don't have to. You should look at the agg::trans_affine class in the agg_trans_affine.h file.
Dave