Quick Search for:  in language:    
PURE,CODE,ANY,FAST,most,successful,program,ti
   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.
Click here to see a screenshot of this code!A#vb Undernet suczs
By Xasan on 6/30

(Screen Shot)

CAPS Trigger
By Trevor Burley on 6/30


Auto clip picture
By Kenneth. Jakobsen on 6/30


Click here to see a screenshot of this code!Game of life clone (cool math)
By Johannes B on 6/30

(Screen Shot)

String to CHR()
By Nikhil Raj on 6/30


Encryption Decryption Demo
By Nikhil Raj on 6/30


Click here to see a screenshot of this code!Serial Registration
By Christian (eXonite Team) on 6/30

(Screen Shot)

Click here to see a screenshot of this code!Danger:Can pc kill me? interesting article
By Xasan on 6/30

(Screen Shot)

AniViewer
By Jerrame Hertz on 6/30


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



 
 
   

REAL TIME TEXTURE MAPPED 3D IN PURE VB CODE!!!

Print
Email
 
winzip icon
Submitted on: 7/26/2000 4:31:24 PM
By: Simon Price  
Level: Intermediate
User Rating: By 36 Users
Compatibility:VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 12314 times.
 

(About the author)
 
     The most successful program of all time on Planet Source Code is RJSoft's textured 3D cube, it has had 176 excellent votes for it including my vote. People obviously were impressed by real time 3D texture mapping - it's the best graphics you can get. RJSoft's program produced these cool graphics using DirectX 7, it is a very well written program. But what if I were to tell you that it is possible to do this WITHOUT DIRECTX?! Yep, this is texture mapped 3D in PURE VB CODE! It doesn't use DirectX, no OpenGL, no DLL's, just label and image controls, and NO DRAWING API's - not even Windows ones. It doesn't use ANY API's in the main rendering loop!!! Yet it still has several rendering modes to choose from and runs at the following frame rates (on my 400Mhz PC). Corners Only - 135 FPS WireFrame - 120 FPS Outline - 110 FPS Flat Colour Polygons - 40 FPS Single Texture Mapped Polygons - 20 FPS Multiple Texture Mapped Polygons - 11 FPS That's FAST! I don't promise the graphics to be as good as RJSoft's program, but I do promise they're done in pure VB code. You can spin the cube on the x,y and z axis and stop it too. You can change the rendering mode by pressing the spacebar. So, 176 of you voted for RJSoft's program using DirectX, I hope you think this deserves a vote too. NOTE - for best performance run the compiled .exe (supplied) and close all other programs. This doubles the frame rates!
 
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 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 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 31 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 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
7/26/2000 4:36:16 PM:Simon Price
To RJSoft
I hope you didn't mind me 
refering to your program, but I had to 
since it was your program that made me 
write my one - I thought I'd copy 
whatever was the best program on PSC 
and it was your's! Ofcourse, I like to 
do things without DirectX so the 
program changed dramatically, if you 
look at the source code I'm sure you'll 
see that I haven't copied a word of 
your code. NEway, thanks 4 your prog, 
it inspired mine!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/27/2000 9:08:27 AM:Erik Forbes
This is pretty sweet. :) Usually, I 
don't download Rotating Cube examples, 
but I thought I'd check it out 
anyway.
If you can find a more 
constructive way to use this knowledge, 
I'd be more inclined to vote for it... 
Perhaps do what one other author did 
and make a 3D Landscape Engine.
Just 
thought I'd add my 2 cents worth. :) 
Good job, hehe :)
Erik Forbes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/30/2000 1:34:36 PM:RJ Soft of West Tennessee
No, I don't mind at all.  I have looked 
at your code and ran your program.  
While the idea is ok, the results are 
not as good as using DirectX.  DirectX 
was created to make graphics fast and 
easier to use then direct code.  Trying 
to do this in pure VB is ok but not 
very practical.  You did a fine job on 
this example so dont take this in bad 
light.  Your example shows you can work 
with graphics without use 3rd party 
dlls.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/30/2000 1:54:40 PM:Simon Price
You're right, it's a bit dumb to make 
3D stuff in VB. But if I ever get that 
C++ and assembler stuff in my head it 
might be a bit more useful...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/5/2000 7:43:09 AM:Nick Thompson
Well done - I've been trying to work 
out how to do this for years, and now 
after looking at your code... I'm still 
trying to workout how the texture 
mapping thingy works. Excellant code 
however it works
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/12/2000 8:02:31 AM:rino_2
Very good although it would be much 
better using DX.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/12/2000 11:18:26 AM:Marc Burgess
Wow, great, and stuff... Your coming up 
with alot of decent stuff, but can't 
use use that giant brain of yours to 
come up with a full game, rather than a 
spinny cube thing. From what i've seen, 
you should be able to do more than 
this, even if it means losing textures 
or somthing.. And what happened to the 
VBDoom game? If you put monsters on it, 
I would like to see it. And anyway, I 
don't see how you can call it VBDoom, 
when it is nothing like Doom, and 
everything like Wolvenstine. You don't 
see me calling my tank game VB Unreal 
Tornement do you?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/12/2000 11:26:38 AM:Marc Burgess
Hey, don't get my wrong, I like all 
your stuff, but you gotta admiit, a 
game would be better than a spinny 
cube. And keep up coding in VB, its the 
best language in the WORLD!! Thats why 
90% of planet source code in for VB!! 
After all, last year, there was about 
one 3D example on PSC, now there are 
loads, with Texture maps, full games, 
and DriectX - give it another 12 
months, and people will be writing 3d 
games in VB and selling them on the 
open market. Every thing but VB s'ucks 
ass!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/24/2000 5:16:02 AM:Michael L. Barker
Nice job! I'd vote but I hate demos 
that nag me.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/24/2000 5:26:01 AM:Richard Hayden
It runs VERY fast on my 
950MHz.
Corners Only: 400 fps.
Wire 
Frame: 351 fps.
Outline: 356 
fps.
Flat Colour Filled Polygons: 170 
fps.
Affine Single Texture Mapped 
Polygons: 50 fps.
Affine Multiple 
Texture Mapped Polygons:
32 
fps.
That IS fast!
Well done on 
another excellent project!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/24/2000 11:21:13 AM:Allen Clark Copeland Jr.
I don't know if this has happened to 
other people, but I'm running windows 
2000, and when I ran your example, I 
got a nasty surprise.  The entire cube 
was tilted on its side, I'm not sure if 
it's supposed to do that, or if it's 
something to do with my computer's 
configuration in general.
(I have a 
500mhz computer, and I got only 32fps 
with corners only, which was tilted as 
well...)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/24/2000 12:44:56 PM:The REAL SESoftware
To Erik Forbes (the second 
feedbacker),
I hate to break it to 
you, bro, but Simon IS the author of 
the 3D Landscape Generator.  Just 
thought I'd point and laugh.  No harm 
meant.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/24/2000 12:48:46 PM:The REAL SESoftware
§hit Simon...  Are you ever going to 
stop creating kick a§§ programs!  WHO'S 
THE MAN?!?!?!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/12/2000 6:00:34 PM:Bill Soo
I liked your code quite a bit. I was 
toying with ways to do this for some 
time now. However, in dissecting your 
code, I came across 2 errors.
1) 
After awhile, the code can lock up in 
an infinite loop in the 
AffineScanPolyEdge routine. It's caused 
by the program looking for x = x2 or y 
= y2 when it should be something like x 
>= y2, since you are using variants 
instead of bytes.
Which brings 
up
2) you are using variants instead 
of bytes in two of your most code 
intensive routines. The statement
dim 
x,y,z,i as byte
actually declares 
x,y,z as variants and only i as a 
byte.
After redeclaring your 
variables, I went from 11fps to 17fps.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/22/2002 8:59:46 AM:VirtLink Software Productions
Looks great, but it can be a bitty 
faster when you remove the 'setpixel' 
statement. Looks the same, but draws 
also negative.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/4/2002 11:31:38 AM:Artist
Tutorial is great man, if you need an 
artist, contact me (alas@EUnet.yu), I 
wanna help for skeletonX, but I can't 
reach your mail... <:-(
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 code 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 code, 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.