Quick Search for:  in language:    
HTML,LONG,TIME,VOTE,PSC,Tutorial,Direct3D7,Re
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
Locate Database
By Erica Ziegler-Roberts on 6/30


Organize the errors of your programs
By Toni on 6/30


how to open and close access database
By Freebug on 6/29


Click here to see a screenshot of this code!PSC-Browser
By Ralph LONG Metz on 6/29

(Screen Shot)

Click here to see a screenshot of this code!Quadratic Solver 2
By Guillaume Couture-Levesqu e on 6/29

(Screen Shot)

Click here to see a screenshot of this code!Array Example
By Cold Fire on 6/29

(Screen Shot)

Click here to see a screenshot of this code!Reconstructor 3.0
By Peter Scale on 6/29

(Screen Shot)

Click here to see a screenshot of this code!Subtitles Manager
By KarahaNa on 6/29

(Screen Shot)

XPlorer
By ZProse on 6/29


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

__Direct3D Tutorial [Updated]__

Print
Email
 

Submitted on: 1/1/2002 3:37:03 PM
By: Matt Carpenter 
Level: Intermediate
User Rating: By 76 Users
Compatibility:VB 6.0

Users have accessed this article 18591 times.
 
(About the author)
 
     A Tutorial on how to do Direct3D7 Retained Mode Graphics! HTML file and an example! Every line of code is commented and easy to understand. Begin making 3D Games with this article! I WORKED A LONG TIME ON THIS ARTICLE! If you like it, PLEASE VOTE FOR ME on PSC :) I am also planning on putting out a 3D flight simulator soon so keep lookin-

This article has accompanying files

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Download the tutorial and example source code :) You may find this example really boring so make it more exciting your self. Try making a 3D maze! Or maybe a racing game! What? You don't have any clue how? You will if you read this tutorial!
After you read it:
1: Rate this- I'd like to hear what you think!
2: Make your own cool D3D Game

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
3)Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 20 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
1/1/2002 4:02:46 PM:Burbble
I get an Automation Error on this line: DD_Main.SetDisplayMode 640, 480, 32, 0, DDSDM_DEFAULT 'Set Resolution and BitDepth (Lets use 32-bit color)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/1/2002 5:24:13 PM:Cool
1 Question How Did You Get That Comment To Come Up... If You Can Just Leave A Post That Would Be Great Thanks!! :) And It works Perfectally For Me!! Very Sweet.. Im Still Trying To Figure Out How To Make The Stairs And What Not How You Got It Those Colors and stuff Thanks Bye...Ace1DW1@Hotmail.Com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/1/2002 5:44:52 PM:Justin Pinkley
This is a great intro to 3D. Good work!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/1/2002 7:01:25 PM:Ace315
what program did you use to make the building.x file? and can this be easily converted to directX 8?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/1/2002 7:38:22 PM:Matt Carpenter
Ok, First answer, you may want to try a larger screen resolution, or maybe 16bit color. I used anim8or (www.anim8or.com) to make a 3DS File, then I used a converter to convert it to a directX file. It should be compatilbe with DX8 but I'm not sure.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/1/2002 8:03:48 PM:Ty
First off, I'd just love to applaud you. I think that you did an excellent job on creating this tutorial. Also, use of comments is great, and that makes the entire tutorial so much better!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/1/2002 10:30:35 PM:Matt Carpenter
Get what comment to come up? the one on the .zip file? click actions, then click 'comment' (if that was what you were asking)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 2:33:13 AM:Ace1DW1
Yeah The Zip Comment... Ive looked.. THANK YOU SO MUCH... With Both
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 10:07:54 AM:Visualcode
I dont know if this will help but the screen shot looks great and ive wanted to learn 3d stuff for a long time ill give you 5
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 2:18:54 PM:Ace1DW1
Ive made This Big Sene With Anim8or And I Need To KNow How To Convert To Something Like Building.x??? Website??? Thanks Ace1DW1@hotmail.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 2:23:25 PM:Matt Carpenter
Search for a program called Conv3DS. Its a 1996 program by Microsoft. You use it to convert 3ds's to .x's.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 3:25:10 PM:Ace1DW1
I Have Files Named .an8 umm I Used That Anim8or.exe Thing From The Website Above.... Im Clueless
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 3:29:15 PM:Ace1DW1
What.. I Went To Configure And Now What Do I Put In The 3 Boxes Sorry For Flooding
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 6:12:05 PM:Matt Carpenter
you have to go to 'objects' then go to 'export' then export your file as a 3DS. Then convert it using a free program you can find and dl called Conv3DS
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 6:13:14 PM:Matt Carpenter
it wont convert .an8 files. You have to export them as .3ds's
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 7:51:42 PM:Ace1DW1
How?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 9:59:44 PM:Matt Carpenter
with anim8or up, click objects, then click export.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2002 10:08:12 PM:Matt Carpenter
Well, about 900 ppls look at it, and only 8 rate it... Thanx to you that DID rate it :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/3/2002 5:22:43 PM:Matt Carpenter
9, thanX!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/4/2002 1:46:31 AM:RicHagen
Nice work , but it's not cool to complain about the number of votes you receive
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/4/2002 2:23:13 PM:Matt Carpenter
sorry, being 13 years old and able to win $200 software in one month, and all.. you get the point...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/13/2002 7:46:19 AM:Mark Withers
Don't boast about winning stuff... Ive won twice in two months in the past. Infact 3ds to X's was not only developed by Microsoft but a later version was made by Discreet. Developers of "Max studio 4" Conv3DS.exe Anyhow overall it was worth the download... the comenting was good, very basic Direct3D concept... using X files... Graphics not so good but easily improved. Try perhaps changing the rotation speed...I can't exactly remember but did you use Tan, Sin and Cos in this tutorial? Did you know that Conv3DS.exe "Convertor" can also change X files back into .3ds files... this helps when i'm using 3D studio max 4 to make scenes. I'd think this work deserves 4 Globes....
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/17/2002 5:34:48 PM:Matt Carpenter
Whatever i say is the wrong thing to say...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/18/2002 2:12:18 AM:Hurrotisrobbo
Hey, don't bag out Matt here about the 'complaint' he made. It was perfectly justified #8) Stacks of people come here, download it, and not acknowledge who's made it... not that fair, ne? すごいのだ ! Good stuff, Matt, keep it up!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/28/2002 12:10:04 PM:Niels
Great tutorial, thanx for bringing this knowledge to the people :) You got my vote
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/29/2002 11:26:59 AM:Maniac
Thanks MAtt. This is really cool.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/23/2002 5:35:51 PM:Creator of Legolas
I am 14, and Kind of inexperienced with VB. I haven't used the tutorial yet but I will. I will comment when I am done, but so far it sounds great!!!!!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/25/2002 4:57:54 PM:Roope
I even logged in to vote EXELENT for this, that should tell it all. (For beginners)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/28/2002 3:52:29 PM:Chris
This is great ! Have always be looking for this. 5 Stars !
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/28/2002 9:47:42 PM:Chris
I would like to know how to Rotate the Camera Up, Not move it up. Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/7/2002 2:30:18 PM:Frederico Machado
Hi! I really liked your tutorial, and I need your help with lights. Can you help me??? (I made a game with your tutorial, Direct3D 1st person game) it's on PSC
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/12/2002 6:21:17 AM:<>
Chris: How to rotate camera. I think it goes something like this: <object>.AddRotation D3DRMCOMBINE_BEFORE, 1, 0, 0, Sin(5) (where <object> is ur camera (defined as a frame though...)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/12/2002 6:21:47 AM:<>
i am not sure if i did it right by the way,.,...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/12/2002 6:24:48 AM:<>
Well i think i am sure it wont work... it should look soomething like this (i think): <object>.AddRotation D3DRMCOMBINE_BEFORE, 0, 1, 0, Sin(5) the last part is the angle it rotates... ( ithink :))
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/14/2002 8:47:11 PM:Pawnee20
very well done Matt. Been trying to find a way to use my 3d skills as well as my programming language skills to create a RPG. This tutorial really is simple to understand and covers all the basics (lights, frames, meshes). Keep up the good work. 5 stars from me! :-)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/25/2002 9:30:22 PM:Brain
Okay i get a run time error '-2005532527 (88760091)', if that means any thing to you. Any way, it dosen't do any thing and the line in question is
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/25/2002 9:33:49 PM:Brain
Set D3D_Device = D3D_Main.CreateDeviceFromSurface("IID_ID irect3DHALDevice", DD_Main, DS_Back, D3DRMDEVICE_DEFAULT) Can you help me?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/9/2002 12:38:38 PM:Darksoft.net
Well done example. Easy to follow, and well commented. I have been looking for a very basic tutorial to start programming in 3d. This is a great start.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/2/2002 11:38:58 AM:Feing
Great 3d tutorial, i surfed the web for a long time for one like this.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/24/2002 6:07:40 AM:Paul A. Smith
ive looked for ages for such a tutorial... typed it all by hand(and it worked... ;-) ) cant wait to make my own programs... greetz Paul ps: 5* from me!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/5/2002 5:18:03 PM:mark
Thanks for taking the time to share the knowledge , it has already helped me alot. Gave ya five
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/15/2002 5:21:47 AM:Nathan
very good 3d example lots of help, but what convertor do you use to convert th 3ds files to .x files?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/15/2002 7:22:57 AM:Nathan
me again i tried to add my own buildings to it (i made em in 3d studios max) and converted it to .x but when i start it nothin happens its just a white screen. plz help!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/16/2002 1:47:32 PM:coder86
Great tutorial, I hope to use DirectX for my PC emulator...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/16/2002 2:52:30 PM:Fred Shmurtz
This code is copied from Roel Janssen's 3D ship code also posted here, type '3d ship' in search.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/28/2002 7:00:20 PM:angry madman
fred is rite, the code is copied
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/13/2002 8:25:15 PM:George Vassilenko
THANKS A LOT dude i dident know shir u gave ma a jump start on direct X ive edited your program oh yeah the resolution of the backround has to be smaller or = 320 * 240 for it to look right, i allso added a car and now im racing around the box hehe dont really care if u copied the code.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/26/2002 7:07:18 PM:Tim
is there any way to have something, that will hold were the camera position is in numbers (such as: dim xpos as single and then like have the xpos hold were the camera x position is?)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/26/2002 8:00:38 PM:Tim
(adding to my last comment above)... i need to have this so i can do something like: if the position = # then it does something
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/31/2002 9:25:16 PM:Matthew Li (mazzanet)
tim, use vectors: Dim camvec as D3DVECTOR <cameraobject>.GetPosition Nothing, CamVec msgbox camvec.x msgbox camvec.y msgbox camvec.z
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/1/2002 12:42:41 AM:
i get an automation error on: Set D3D_Device = D3D.CreateDeviceFromSurface("IID_IDirect 3DHALDevice", DD, BackSur, D3DRMDEVICE_DEFAULT) i tried changing it to RGBDevice but got the same (i don't have a 3d graphics card!!)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/1/2002 3:44:57 PM:
for
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/1/2002 3:47:27 PM:
this is for matthew li... where do i put the <cameraobject>.GetPosition Nothing, CamVec msgbox camvec.x msgbox camvec.y msgbox camvec.z...... and is the <cameraobject>.GetPosition just: FR_Camera.GetPosition??
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/3/2002 8:52:18 PM:
hey, forget the message before, i know how now...... but does anyone know how to have another mesh, & it will be able to move with the camera? (so i could make a character or something)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/27/2002 11:34:36 PM:
This is great!!! I give it 10 out of 10!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/21/2002 7:13:43 PM:Jefff
Help! When I make a 3ds file and convert it into x with conv3ds it gives an automation error! Do you need to add any parameters to the conv3ds program such as -A?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/21/2002 7:14:56 PM:Jefff
Sorry for not explaining my problem to well above. When I have my x file and I load it from vb I get my error. Not when converting it
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/28/2002 12:40:23 PM:
I keep getting this error when i try and put my own meshes in.... I've tried to change the screen res but still the same err, but on a different line of code. I dunno wats wrong. I used 3ds Max 5 to create the cube for the mesh and i used the converter (conv3ds), then i just tweaked the path of ur code where it said blah blah blah App.path
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/28/2002 12:43:25 PM:
(conti. of previous, got cutt offf) blah blah blah App.path & "\building.x" ===>>>> blah blah blah App.path & "\box.x". I just cant figure it out. By the way, teh err was Automation something. Great Guid tho, all the way!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/28/2002 3:29:26 PM:
Sweet code...I Rated it 5! Keep it up! This is awesome!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/25/2003 10:32:37 PM:Daniel Kerr (Hawk)
WiCkId!!!! * 5 *
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/13/2003 12:44:09 PM:vbnick
fine piece of work...congrats..
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/25/2003 8:48:37 AM:Thorben Linneweber
Very good! '5 Points I have one question... '''''To'''''''ROTATE''''' ''''''''' Const Sin5 = 8.715574E-02! ' Sin(5°) Const Cos5 = 0.9961947! ' Cos(5°) FR_Camera.SetOrientation FR_Camera, -Sin5, 0, Cos5, 0, 1, 0 '''''''''' This is to "look" right/left... But how can I "look" up??? Thank You
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.