Important alert: (current site time 7/16/2013 3:32:08 AM EDT)
 

winzip icon

SI'S DIRECT 3D PARADISE

Email
Submitted on: 8/13/2000 6:16:09 AM
By: Simon Price  
Level: Intermediate
User Rating: By 46 Users
Compatibility: VB 5.0, VB 6.0
Views: 31316
author picture
(About the author)
 
     A WHOLE 3D PARADISE TO WALK AROUND IN REAL TIME!!! This is my first Direct3D program (apart from a plain cube). It demonstates lots of the basic stuff you need to use to make a Direct 3D program, such as : Z-buffering, texture mapping, matrices, polygon sorting and scrolling backgrounds. The 3D world includes a plane and a boat, and some trees. All this packed into a 264KB download! I made the trees using a trick I saw on the game Tombraider - they are 2D sprites which turn to face the camera! Even if this don't teach you much, you can at least have a laugh at the ridiculously low polygon count and cheap effects. NOTE : YOU NEED DIRECTX 7 INSTALLED TO RUN THIS! For the best performance, close all other programs and run "Si's 3D Garden.exe" (included). See "readme.html" for more information. Please COME BACK AND VOTE FOR THIS because I don't think anyone else has given up the source code for a whole 3D world to Planet Source Code!
 
winzip iconDownload code

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 Winzip to 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 code, you agree to the following terms...   
  1. You may use this code 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 code (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 code 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 code or code's description.


Other 30 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/13/2000 6:19:42 AMSimon Price

Hello people

Sorry I couldn't include a screenshot, it made the upload too big and it wouldn't work. But once you see it in action, I hope you come back and vote 'cos this took a week of learning to make.
(If this comment was disrespectful, please report it.)

 
8/13/2000 11:26:29 AMWILKSEY

I havent seen it in action yet, but as it sounds so cool, i'll vote it excellent anyway, i'm sure it is as good as u say it is anyway.
(If this comment was disrespectful, please report it.)

 
8/13/2000 5:01:34 PMHabeeb

all i get is an automation error
(If this comment was disrespectful, please report it.)

 
8/13/2000 5:06:24 PMSimon Price

Automation errors are to do with DirectX - either you haven't got the right version installed another program is stopping my program from using it, or you don't have enough memory. Or you don't have 16 bit memory (unlikely). Tell me more and I can help you fix it.
(If this comment was disrespectful, please report it.)

 
8/13/2000 5:09:03 PMSimon Price

By the way if someone does get this working please tell me so. It may help me fix the bugs. And I'd like some positive feedback for a change!
(If this comment was disrespectful, please report it.)

 
8/13/2000 5:30:31 PMHabeeb

I've got plenty of system power & memory and I *believe* I have dx7...but how do I check my version of direct x?
(If this comment was disrespectful, please report it.)

 
8/13/2000 8:54:29 PMxXx_VipeI2_xXx

Automation Error here too =/
(If this comment was disrespectful, please report it.)

 
8/14/2000 3:38:04 AMSimon Price

Thanks Nathan, I'm glad my code worked for someone. At least this proves that it is a compatabilty problem. I just found out that I have DirectX 7a? Maybe I am using a feature new to version 7a?
(If this comment was disrespectful, please report it.)

 
8/14/2000 4:16:35 AMDa_Mental_One

That is way Kewl! I like it!!! Got a full 5 globes from me!!! :) I kept on crashing into to house tho... Made me feel like I had x-ray specs on... LOL Keep up the gr8 work Budski!!! :)
(If this comment was disrespectful, please report it.)

 
8/14/2000 5:03:04 AMRik

The problem may well be Windows 2000 related - for the most part, anything written in DirectX 7.0a with VB doesn't run properly on Windows 2000 (according to Microsoft's web site - http://msdn.microsoft.com/msdn-online/shared/comments/threadedcomments.asp?cID=12219&aID =2063)
(If this comment was disrespectful, please report it.)

 
8/14/2000 6:33:35 AMSimon Price

Well done Rik, thanks alot!!! So there you have it people, THIS DOESN'T WORK WITH WINDOWS 2000 (before I get anymore complaints). Sorry, there's nothing I can do about that, if you have Win2K then tough.
(If this comment was disrespectful, please report it.)

 
8/14/2000 6:34:21 AMRik

Sorry, just to add - the error I get refers to DDERR_NOTEXTUREHW - this means that no texture-mapping hardware is available or present. Any ideas Si ??
(If this comment was disrespectful, please report it.)

 
8/14/2000 8:23:43 AMRichard Hayden

I get automation errors ONLY when running it from the exe. NOT when interpreting it in the IDE. I'm using Win98SE DX7.0a.

My problem is that, yesterday I ran your prog and it worked fine, but today when I run it says, Invalid procedure call or argument, highlighting the line of code, "DX3DDEV.SetTexture 0, Tex(TEX_WALL)". I expect I'd get the same error on your other DX3DDEV.SetTexture() calls. I've NOT edited your prog in anyway, and it worked fine, until today.

*** I did install the DirectX7.0 SDK yesterday evening, but I don't think that should cause any problems. ***
(If this comment was disrespectful, please report it.)

 
8/14/2000 10:02:35 AMjparks

You can check your DirectX version by typing dxdiag at the Start/run prompt.
(If this comment was disrespectful, please report it.)

 
8/14/2000 10:52:19 AMRik

Ok - last thing !! It does work on Windows 2000 - but it seems to depend on your graphics card !! Some graphics cards will not support the DirectX texture calls - hence the Automation errors. Therefore, it will work with a Matrox G200 - but not with a NeoMagic 256AV. And that's that !!
(If this comment was disrespectful, please report it.)

 
8/14/2000 11:46:49 AMPhoenixX_2@yahoo.com

Hey i get an automation error too. But it's the : DDERR_NOTEXTUREHW wich is, I DON'T KNOW. I have no 3d acc card btw...
(If this comment was disrespectful, please report it.)

 
8/14/2000 1:19:56 PMSimon Price

Thanks for all the feedbakc people, Planet Source Code is a good testing ground. Next time I make a Direct3D prog, I'll include LOADS of error handlers, especially the one for if you've got no texture mapping hardware! I'll try to make a new program using all the feedback you've given me. Thanks for the excellent votes but please note that while the program works excellent for some, it' don't work at all for others. The moral of the story is don't go learning all that fun texture mapping stuff without first learning the basic error handling stuff!
(If this comment was disrespectful, please report it.)

 
8/21/2000 6:31:45 AMMarc Burgess

Sounded good, but dosn't work for me... Does this NEED hard ware to work then, because I did a program like this abit ago, that didn't have textures, and that worked fine.
(If this comment was disrespectful, please report it.)

 
8/22/2000 11:00:24 AMKenneth Gilbert Jr.

The code worked flawlessly.
(If this comment was disrespectful, please report it.)

 
9/4/2000 2:22:33 AMDaniel Davies

Worked excellent for me :o) Great Work...Again!!!
(If this comment was disrespectful, please report it.)

 
9/5/2000 9:44:29 PMRich

It worked excellent for me after I updated to DX7a.
(If this comment was disrespectful, please report it.)

 
9/7/2000 1:47:13 AMNLS - Nonlinear Solutions

Nice job. I gave you four globes. And ... a low polygon count is considered a *good* thing. On the other hand: "I don't think anyone else has given up the source code for a whole 3D world to Planet Source Code"? Check out Eye3D source just to make sure. ;-)

(If this comment was disrespectful, please report it.)

 
9/7/2000 9:11:31 AMDigital Vampire

I get Automation error too

I'll be back later with the details
of the code part it errors out on !

I am Using DirectX 7.0a since I
Downloaded it just so I can try this
Code.

However I have a distinct feeling this
may be caused by the lack of HardWare
Acceleration .. not sure tho .
(If this comment was disrespectful, please report it.)

 
9/9/2000 1:45:44 PMlord_illogical

i added an error trap to sub RenderScene and found i get an automation error on this line :

DX3DDEV.DrawPrimitive D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX, vEwall(0), 5, D3DDP_DEFAULT

drawing side walls, any ideas ?
(If this comment was disrespectful, please report it.)

 
9/9/2000 2:03:14 PMSimon Price

TO ALL PEOPLE WHO HAVE HAD PROBLEMS RUNNING THIS : TRY EDITING THE PICTURE FILE "sidewall.jpeg" TO MAKE IT A SIZE OF 256 X 256 PIXELS. THIS WILL FIX THE GAME IF YOUR MACHINE HAD PROBLEMS WITH NON-SQUARE OR LARGE TEXTURE MAPS. IF THIS WORKS FOR YOU, PLEASE TELL ME SO THAT I AND OTHERS KNOW FOR NEXT TIME SOMEONE MAKES A DIRECT3D PROGRAM. THANKS FOR ALL THE VOTES TOO.
(If this comment was disrespectful, please report it.)

 
9/9/2000 2:05:02 PMSimon Price

ALSO EDIT "SKY.JPEG" TO MAKE THAT SQUARE TOO. MAKE EVERYTHING SQUARE AND 256 X 256 AND IT SHOULD WORK. I MIGHT RELEASE A BETTER PROGRAM SOON THAT IS COMPATABLE WITH MORE PC'S, AND HAS MORE ERROR HANDLING CODE.
(If this comment was disrespectful, please report it.)

 
9/11/2000 12:31:08 PMRichard Hayden

I'm using a 950Mhz, 256Mb RAM, GeForce II, 64MB GTS graphics and I get automation errors from a compiled exe and an interpreter error when interpreting which looks like this:

"Invalid procedure call or argument" and it highlights:

"DX3DDEV.SetTexture 0, Tex(TEX_WALL)"

It seems like it could be good, if it worked, though!

(If this comment was disrespectful, please report it.)

 
9/11/2000 2:31:35 PMRichard Hayden

RE previous e-mail:

Yeah, I will try and sort 'SetTexture' etc. myself, but when it does work, it must be the best bit of Direct3D I've seen on PSC VB!(I've tried it on my 200MHz and it works, albeit slowly, but it works!). I haven't seen anything as good as it in any open source VB site I've been to, not that I've been to many! I'm sure with work you could make a dámn good VB based game (shoot 'em up), probably one of, if not the best VB game ever made. I'd like to try and get it to work so I can make use of this excellent Direct3D example.

Thanks again for sharing this excellent piece of code and your interest in user feedback and problems.
(If this comment was disrespectful, please report it.)

 
9/12/2000 6:41:07 AMNeil Ramsbottom

Has anyone had any trouble running this on W2K Advanced Server?

Does it work with a Voodoo3 for anyone else?
(If this comment was disrespectful, please report it.)

 
9/15/2000 2:59:21 AMecko

works on my win2k

(If this comment was disrespectful, please report it.)

 
9/19/2000 1:32:26 AMjosh

for those interested in vb games should take a look at vbgaming.com
(If this comment was disrespectful, please report it.)

 
9/21/2000 10:14:13 PMCoryUlui

I'll vote for you not because you said, (which was a silly thing to do)... but because ur code rocks..... tell the truth now where'd u get it from... LOL
(If this comment was disrespectful, please report it.)

 
9/26/2000 2:29:21 PMRichard Hayden

Just back to say that over a month after I downloaded this, I am still amazed at what can be done with VB in Direct3D! I never this type of 3D program was possible in VB, but I was proved wrong!

Thanks, Again.
(If this comment was disrespectful, please report it.)

 
9/28/2000 5:56:24 AMSauron

This code is cool and it worked on my system as soon as I tried it.
This is the best code I have downloaded of PlanetSourceCode.com yet :)
(If this comment was disrespectful, please report it.)

 
10/28/2000 11:11:45 PMJason Brimblecombe

Excellent! I am really interested in this sort of stuff, so could you tell me how you learnt to do it? E-Mail me sometime! jbrimble@vbcity.net
(If this comment was disrespectful, please report it.)

 
11/15/2001 3:52:14 PMMichael Barnathan

I must say, well done. 5 Globes from me. And it does work with WinXP, although it might not work with 2k.
(If this comment was disrespectful, please report it.)

 
12/20/2001 5:40:25 PMBill Gates

Kinda slow... Great *Cough*
(If this comment was disrespectful, please report it.)

 
7/1/2002 11:02:59 AMSkitzo Monk

I got it working briliantly, the only 2 things that wudda made it better was, better artwork and the option to turn while moving forward
(If this comment was disrespectful, please report it.)

 
8/31/2002 4:05:17 PMJacob Roman

AWESOME!!! But there where some collision detection problems. I had to practically shake myself pass the trees. Besides that, it ruled!!! 5 globs of goop from me dood!
(If this comment was disrespectful, please report it.)

 
1/3/2003 10:20:09 PM

I havent downloaded this yet, but i've noticed many people say that they are having automations erros and not specifying that they have win2k.

You can sometimes get an automation error in dx if your bit depth and resolution is not correct, try adjusting that!

Peace!
(If this comment was disrespectful, please report it.)

 
7/13/2004 2:22:46 PM

GREAT JOB MAN!!, realy good example
Here you have 5 stars ***** from me!!!!
Keep on working this way!
(If this comment was disrespectful, please report it.)

 
10/30/2004 6:49:51 AMKing Of The Dragons

Doesn't work on xp sp2
(If this comment was disrespectful, please report it.)

 
3/6/2005 6:53:05 AMIceMouse

can u teatch me? :P:P
(If this comment was disrespectful, please report it.)

 
5/7/2005 12:31:31 PMjonathan waller

It is the best 3D thing that i have found so far on PSC. I like it.
(If this comment was disrespectful, please report it.)

 
5/26/2005 11:29:40 PMDamien Villeneuve

Very nice ! It's work correctly at the first try ! ... but slow :P Nice.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.