Jump to content

Creating a Cube in 3D space C++

- - - - -

  • Please log in to reply
6 replies to this topic

#1
Blimp

Blimp

    Programmer

  • Members
  • PipPipPipPip
  • 154 posts
Hi everyone,

How would I go about showing a 3D cube in 3D space on C++? I understand I need Direct X SDK installed - Which I already have.

Saying that with everything you need to include a header file, I've added the Windows.h file and the D3d10.h file (Direct X 10).

This is my code so far, yes, I know there's nothing there but I just want a little bit of help on where and what to put.

My filename is main.cpp


#include <Windows.h>
#include <d3d10.h>

int main(){





}

Can someone help me? Thanks!


EDIT : I'm using VS C++ 2010

Edited by Blimp, 09 January 2011 - 03:19 AM.


#2
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
This looks promesing. Haven't checked out everything but I think you'll get basics there.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#3
Blimp

Blimp

    Programmer

  • Members
  • PipPipPipPip
  • 154 posts

Flying Dutchman said:

This looks promesing. Haven't checked out everything but I think you'll get basics there.



Thanks Flying Dutchman,

I also found another tutorial using OpenGL - some people may find that useful!

#4
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
I assumes you wanted only DirectX. Here, here and here are OpenGL tutorials that you might wanna check out. I'd recommend you though that you use SFML (C++) or SDL ( C ) librarys which do most of window creation and input work for you.
A conclusion is where you got tired of thinking.
#define class struct    // All is public.

#5
artificial

artificial

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 624 posts
IMHO, programming with OpenGL is easier than with DirectX... but that's a matter of attitude.
If you want to learn OpenGL, take a look at this: Link (Flying Dutchman's links are better though)

Greets,
artificial
Sometimes words ain't enough to express something. That's why computer scientists use double words.

#6
Infinity

Infinity

    Newbie

  • Members
  • PipPip
  • 24 posts
Anyway, start with 2D applications, its better for beginners.

#7
hradecek

hradecek

    Newbie

  • Members
  • PipPip
  • 12 posts
OpenGl's GLUT library is really simple and u haven't to know anything from WIN API...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users