Important alert: (current site time 7/16/2013 3:21:19 AM EDT)
 

winzip icon

D3DWorld Version 2.0 (Direct3D 8)

Email
Submitted on: 12/17/2000 5:52:19 AM
By: Rich Hayden  
Level: Intermediate
User Rating: By 50 Users
Compatibility: VB 6.0
Views: 32318
(About the author)
 
     Version 2.0.0 of Richard Hayden's D3DWorld is a great improvement on version 1 (D3DScene) of my Direct3D 8-based 3D world. Lighting is now used in many shapes and forms to enhance this scene. I have also improved the program, making it more efficient and it runs slightly faster. I have added a church-style building to the world (complete with stained-glass windows), which looks pretty effective. Six times of day are now simulated realistically using lighting. The screenshot below was taken when the time of day was set to evening. Next I hope to add collision detection and transparency and billboarding, to simulate objects like trees etc. If anyone can help with the collision detection and transparency areas, then please do. (r_hayden@breathemail.net). I also hope to make a more realistic sky. So look out for any proceeding versions! Please vote and/or provide feedback in return for me making this code available to you! On my last submission I was quite dissapointed that out of about 400 visits, there were only 4 votes and about 2 feedbacks, apart from my own 2 comments. Really, the least people can do for developers who put up their code here for free, is to rate it!

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :D3DWorld Version 2.0 (Direct3D 8)
'**************************************
See 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 6 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
12/17/2000 9:02:36 AMKrishna Rath

wow! another teen from England doing great work.
Nice game, though my P-166 could not play it well.

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

 
12/17/2000 9:05:21 AMKrishna Rath

why do you want useless comments like this?? I mean you said only 4 feedbacks were posted on your last submission.
Most of us download and then forget to vote, and the feedback is only if you have understood the code/ or the code has blown off the comp.
keep coding...
(If this comment was disrespectful, please report it.)

 
12/17/2000 10:31:29 AMJeremy Hope

how come some of the project libraries are missing, like Direct3DVertexBuffer8?
(If this comment was disrespectful, please report it.)

 
12/17/2000 11:35:48 AMKurt Maine

Hey, Love your idea of making an 3d world! ive actually been in one of those for a year or so now, if you need any more ideas goto activeworlds.com, its a 3d universe with many diffrent worlds, i would love to make a 3d world but just dont understand the whole direct3d8 stuff :( anyway Excellent Job!
(If this comment was disrespectful, please report it.)

 
12/17/2000 4:10:53 PMSimon Price

Yes, a great improvement, 5/5 from me again. I'm going to start learning DX8 now and you've given me a great example to learn from. So when I make something, I'll remember to credit you. One problem, I couldn't see the house light, the search light or the green glow. Are those features you've yet to add? I hope you get more votes, I seem to remember my 3D world getting loads of votes and it wasn't anywhere near as good as this.
(If this comment was disrespectful, please report it.)

 
12/18/2000 7:47:57 AMKrishna Rath

Nice feedbacks..Richard leanred from Simon and Simon learns from Richard and I donot understand a word of DX!!
Why not you both make a VB NFS??
(If this comment was disrespectful, please report it.)

 
12/18/2000 11:24:01 AMChris

Hey Rich,
Looks really good. I can't see any of the lights either, must be this piece of junk I work with. I'll send you a collision detection scheme shortly.
A 5 from me...
(If this comment was disrespectful, please report it.)

 
12/18/2000 12:39:04 PMRichard Hayden

Thanks everyone for all of your
comments & votes! I should have
responded to everyone up to this point
with thanks for votes etc. If I haven't
then do please remind me!

If you are confused about the lighting or it doesn't seem to work, make sure you have changed to evening, dawn, dusk, or night mode (the best to see it) and then turn on the house light, church glow (only on one side!) or search light. You can't see it in midday
mode! (It's too bright!).

If they still don't work for anyone, please contact me (feedback here will do). It could, although I doubt it, be something to do with your graphics card etc...... If the time of day settings work, ie. you have the sun and the moon (yellow and white light emissions) in one of the top corners then the other lights should work, you just need to be in a dark enough time of day.

Once again thanks &
regards,

Richard Hayden.
(r_hayden@breathemail.net)
(If this comment was disrespectful, please report it.)

 
12/18/2000 1:37:06 PMSimon Price

Krishna, what an NFS? OK idea about me & Richard teaming up but I think he's happy making his world as it is.
Chris, I'm interested in collision detection too, if you or Richard could send it on that'll be great.
Richard, as I said in my email but I'll say it to everyone else who can't see lights : I changed the vertex processing to software since I don't have the hardware, this probably effected the lighting. Is there going to be a version 3?
(If this comment was disrespectful, please report it.)

 
12/18/2000 1:49:57 PMRichard Hayden

Simon you're right. Lighting doesn't work on software vertex processing. If anyone has anyway around this, ie. getting lights to work with software processing, please say! Sorry all of you out there who can't see my lighting effects. I think it may be to do with texture and lighting engines on graphics cards, which are obviously not used in software mode. I currently have plans to release a version 3 and 4 maybe......... Hopefully I can implement col. detection in one of those.......
(If this comment was disrespectful, please report it.)

 
12/18/2000 3:02:06 PMRichard Hayden

Hi everyone, me again. If you are having trouble with lighting, try using
D3DCREATE_MIXED_VERTEXPROCESSING in place of D3DCREATE_SOFTWARE_VERTEXPROCESSING. I'm not sure what this flag exactly does to the vertex processing, but I guess it mixes between hard and software processing (don't know how or why). See if you can use lighting then. I'm not saying it will let you, I don't know yet.
(If this comment was disrespectful, please report it.)

 
12/19/2000 12:56:11 AMJacob Allred

reminds me of the good ol' days when AlphaWorld was free (more commonly known as ActiveWorlds now) and VRML based activities were the big thing... anyways program looks great. good job.
(If this comment was disrespectful, please report it.)

 
12/19/2000 10:58:33 AMRik

great. But your textures look 'oribble.

You need bigger ones or something, the all mulsh together and patternise. Look at the house, on that pic, the walls all look messed up and bulgy.
(If this comment was disrespectful, please report it.)

 
12/19/2000 6:33:51 PMUtopian Monarch

Wow, cool. More people who know about ActiveWorlds. Is there a tutorial or anything where i can learn directx (and direct3d) at? I've always wanted to learn how to do that. Screenshot looks great.
(If this comment was disrespectful, please report it.)

 
12/21/2000 4:25:05 AMNathan Chere

Nice code. I myself downloaded the DX8SDK and have been working flat out on designing a flashy intro for my RPG Catalyst but I have had tonnes of trouble with various things and looking at your code has helped heaps. 5 globes!

Oh yeah Simon, I think in NFS he was talking about Need For Speed but that game su©ks balls anyway so don't bother :)
(If this comment was disrespectful, please report it.)

 
12/21/2000 1:04:05 PMAmo

Hi, im a newbie to Direct X based vb programming so I was wondering if you could help me make a program like the one you have submitted? e-mail me at amarjit_chohan@hotmail.com
(If this comment was disrespectful, please report it.)

 
12/21/2000 4:18:22 PMAce315

I get "Unable to CreateDevice (see InitD3D() source for comments)" when I run it, I have a bad video card... would that be why?
(If this comment was disrespectful, please report it.)

 
12/22/2000 5:26:21 AMRichard Hayden

Hi all, if you are having problems creating devices, please wait for the next version. This has device enumeration and the option at the beginning of the program to select between HAL and REF modes and also software/hardware vertex processing.

Then, you can modify my program to work with your system setup without changing the source.

For the moment, try reading thesource and following the various guidelines, ie. changing HAL to REF and hardware to software vertex processing.

Thanks,

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

 
12/29/2000 3:58:55 PMMark Withers

The res sqrews up!
(If this comment was disrespectful, please report it.)

 
1/8/2001 12:03:50 PMRichard Hayden

Wow, I never thought I would get code of the month!!! Well, thanks to all who voted and provided feedback, look out for version 3!
(If this comment was disrespectful, please report it.)

 
1/12/2001 10:02:29 PMjdchristo

Very nice! I have been looking for something like this to help show me the differences in dx7 and 8. i am currently writing a flight sim. Anyhow, thanks for the source! also, try inserting these two lines to improve the quality of the textures. what they do is some blending of pixels or some such thing. all i know is they work... :-)

g_D3DDevice.SetTextureStageState 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR
g_D3DDevice.SetTextureStageState 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR

Jon christopher

PS: can't wait for version 3 and collision detection! :-)
(If this comment was disrespectful, please report it.)

 
1/13/2001 6:39:25 AMMike Canejo

Those two lines did the trick, this looks much better!

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

 
1/16/2001 4:12:11 PMTim

Also cannot create a device for me too. I first started running on a customized card and thinking that was the problem tried on an nVidia TNT2 M64 and a plain TNT model......? They're kind a popular graphics sets your missing!
(If this comment was disrespectful, please report it.)

 
1/19/2001 10:26:42 AMkirk

great example.. well documented!

thanks for sharing!
(If this comment was disrespectful, please report it.)

 
1/25/2001 1:54:59 AMBeuno

good work, keep it up ;)
(If this comment was disrespectful, please report it.)

 
1/25/2001 9:53:49 AMRichard Hayden

Thanks everyone for the votes and feedback. I am currently well on the way to completing version 3, but have unfortunately been slowed slightly by school work. Version 3 should be a lot more reliable and work on a LOT more machines, without those 'cannot create device' problems and problems with lighting.

Once again, thanks!
(If this comment was disrespectful, please report it.)

 
1/25/2001 1:41:03 PMTim Roop

Very Impressive work. I'm just getting into DirectX and this gives me the opportunity to experiment. 5 from me!!
(If this comment was disrespectful, please report it.)

 
2/6/2001 2:58:45 PMSoul

Hey great game, I wish to know where to learn , I want to make 3D games with VB and Im like not good at it, where can i learn more on DirectX please help me, email me at e_man_dan@hotmail.com please
(If this comment was disrespectful, please report it.)

 
6/19/2001 1:08:52 PMCodin Genius

Very cool but the search light, errie glow, houselights and sun/Moon dont work 4 me. Still, I like it, Im just kearning DX 8 though so...Phew...Ill wait a bit before I even attempt to understanfd the code. 1 Globe I think.
SYKE, Only j/k 5 Globes/
(If this comment was disrespectful, please report it.)

 
9/21/2001 4:54:33 PMBrad Harper

I feel that this code is well commented and easy to learn from. I especially like the picture of the gorilla inside the building. Nice work. This type of submission provided me with an idea of the real "power" of VB and DirectX8...
(If this comment was disrespectful, please report it.)

 
10/10/2001 7:28:36 PMSerberus

NICE CODE this has helped me a lot on my DX game.I am having problems running this in the VB Design Environment, I had to changed the D3DDevice to software and D3DDev to REF so it starts up but I cant move and VB6 stops responding. Can u send me an EXE at Dephi10000@aol.com Thanks.
(If this comment was disrespectful, please report it.)

 
12/10/2001 1:03:28 AMAndres Zacarias

Nice code, isnt there around any terrain code?
(If this comment was disrespectful, please report it.)

 
1/12/2002 7:58:21 PMMichael Manning

Why do I keep getting "Unable to CreateDevice (see InitD3D() source for comments)".
(If this comment was disrespectful, please report it.)

 
5/20/2002 3:50:16 PMalaina

Great code, it was very helpful. I am working on my own 3D game so any feedback from anyone would be helpful, also if someone would like to send me collision detection that would be great thanks a lot!! email @ alaina_g_@hotmail.com
(If this comment was disrespectful, please report it.)

 
11/14/2002 8:19:38 PMVPUCEO

Awesome code man! Definitely a 5/5 from me
(If this comment was disrespectful, please report it.)

 
11/17/2002 2:54:33 PM

Very nice piece of code, a great help for me learning the basics of the Dx8 system. Now lets see... how to drive Young Shamus and E N Z O nuts by making something better than Active Worlds...

Oh, 5 stars by the way :)

- Mark
- Strike Rapier in Active Worlds
(If this comment was disrespectful, please report it.)

 
6/14/2003 1:03:28 AM

I Didn't see the code yet
but i seen the first sample i like this both

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

 
4/17/2004 11:55:33 AMJake Parker

I've mod'ed it to provide
-mmog support
-collision detection
-real physics
-loading maps and .x files
-tonnes of error handling
-mouse that controls pitch & angle
-now ported to c++

I always wanted to make something like this, but I didn't know directx, all the c++ tutorials were junk, this helped alot, thanks!
(If this comment was disrespectful, please report it.)

 
6/9/2004 11:43:07 AM

Very Good!!

If someone would like to send me
collision detection that would be great, thanks a lot!!
My email: xavroi2003@hotmail.com

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

 
7/29/2004 1:11:37 AM

hi...
Its nice to see some one doing what I initially planned to do two years back..I have this idea of creating a virtual planet where we can duplicate the real world. I have a small animations and graphics company in Chennai India and willing to make this virtual planet a reality. I would like to discuss with you further how we can collaborate and do this project I am willing to invest my manpower (10 designers and 5 programmers and in total 20 people in my small company) and time and creativity to this end. Have a look at my website http://www.d3dworld.com and tell me how you feel about it. I have already firmed up the plan about the virtual planet and of its not a small project it will require lot of investment and manpower to do what I want to ultimately come up with. I also have a financial model which we can discuss through the email. shashidhar@d3dworld.com

have fun

shashidhar sharma
CEO

Redefining reality in virtual space
http://www.d3dworld.com
(If this comment was disrespectful, please report it.)

 
1/10/2005 11:58:34 AMSkeeve_S

Hey I would love to help you but everytime I try and email you I get a bounce back. Can you email me at jsmith@grbackup.com. Thanks.
(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.