Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Ive Managed to Simulate Most of DBP's Basic3D In Windows Mobile :D

Author
Message
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 22nd Mar 2010 07:55
This probably wont interest anyone else, but Im pretty proud .

Over the last 2 weeks I have managed to simulate a lot of DBP's Basic3D and Basic2D commands in Visual Basic for Windows Mobile phones using the Windows Mobile Professional SDK and DirectX / Direct3D. Its been a complicated process as Ive never really programmed with DirectX before, other than using DBP (which really isnt programming with DX ). But anyways Ive managed to program an engine that currently supports:

- Creating all of the standard primitive meshes (box, sphere, cylinder, torus, polygon, etc. )

- Loading in .x files (this was really complicated, especially because the WMSDK doesnt directly support .x files, so I had to modify a custom class released by Microsoft for loading in md3dm files converted from .x files using one of Microsoft's converters, and then building the meshes up vert by vert)

- Texturing objects

- 3D Lights

- 2D Sprites

- Translating, Rotating, and Scaling sprites, 3D meshes, and the active camera

- An intersectObject command similar to DBP's intersect object command for raycasting and collision

Alongside all of this Ive learnt how to use the accelerometers built into the newer windows phones (like my new Omnia ) so I can get the phone's xyz angle in the real world.

Everything is written using a strong object-oriented system. Ive tried to simulate DBP's commands while improving them to suit the object oriented possiblities VB allows, eg:

MAKE OBJECT BOX objNum, width, height, depth in DBP converts to

objNum = makeObjectBox(width, height, depth) in my VB engine.

All of the meshes are stored in an object collection, and all of the sprites in another object collection. Both of these collections are automatically looped through and rendered / processed each loop.

My next goals are:

- Figure out how to get access to the phone's GPS (this is my biggest goal as my game idea that this all started from relies entirely on the GPS)

- Support animated 3D meshes

- Add in more collision features

- Add some helper commands like Move Object, Point Object, Move Camera, Point Camera, etc.

- Get D3DText working, havent tried it yet but I doubt itll be hard compared to what Ive gotten working so far

- Figure out how to use MySQL Databases (this ones going to be hard... but a necessity)


Anyways, just thought Id post up with what Ive been working on over the past couple of weeks. If anyone else is thinking about programming for phones I highly suggest it, its pretty cool being able to play your games on phones. Ive already made a few test games, nothing too big just throwing a ball around the screen using the touchscreen and using the accelerometer to cause the ball to fall to the physical bottom of the screen depending on what angle its being heald at. Possibly once I get the base engine complete, Ill consider releasing it or some sort of tutorial to the public, but we'll see as Ive put a lot of work into it. There really isnt much documentation for this stuff on the net, and the fact that out of the dozens of examples Ive tried, only 3 of them have actually compiled successfully.

Well, thats it. I expect Ill get a bunch of "good for you, who cares" posts, but so be it .
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 22nd Mar 2010 09:23
Well I'm impressed

Wow, through VB? Why VB? Sounds like it was a pain! I remember a few years ago before I got into programming I tried hacking together some VB code to allow for hot loading between 3DSM and a VB window. Yeah... no... I think I tried using MFC, it was bad.

Anyway, post up some pics dude! Maybe TGC will bring you on board

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 22nd Mar 2010 11:03
Sounds great, what WM phone and what version of WM have you tested it on?

Looking forward to trying this if you make it available.

Darth Vader
20
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 22nd Mar 2010 11:20
Sounds amazingly cool! I second the notion for pictures, or maybe a vid of the ball game?

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 22nd Mar 2010 11:32 Edited at: 22nd Mar 2010 11:33
Quote: "Wow, through VB? Why VB?"


I'm not sure about previous WM SDKs, but WM7 will definitely not support native code. So it was a damn good choice of lang (whether accidentally or because of this very limitation)

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 22nd Mar 2010 13:15
I will certainly upload some screenshots of the emulator running when I get a chance to write a better looking test game, as right now it is just a bunch of quickly thrown together small apps rotating 3d objects around their centres. Ill also try to get a video of my accelerometer game, as I thought it was pretty cool. I actually implemented a really simple gesture recognition method in the last version that allows you to flick the phone as if it were a ping pond paddle, and the ball sort of jumps "off" the screen (it scales up then scales down, using a simple gravity system).

I chose VB because Ive never dablled with c# or c++. I know one day Id love to learn them, but in terms of what I already knew I figured VB was the way to go. But yeah, in terms of whats out there to learn from, there is really not very much. Almost every example I found was written in c# and Id have to decypher what they were doing and try to simulate it in VB.

David I found that out after deciding to go with VB. However they are also phasing out Direct3D programming itself for the Windows 7 phones, as you now have to use XNA. I wish I had a Windows 7 phone, because Ive done a few test projects with XNA and the process is much easier.

Oh and I have tested my programs on my Samsung Omnia phone I just got 2 weeks ago. But the Windows Mobile SDK comes with a lot of emulators as well, and my programs have run on them all. The varying screen size issue with phones is really annoying though.

Thanks for all the interest
- RUC'
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 22nd Mar 2010 23:39
Ah, that's what I was wondering. Since it was WM Phone I was thinking C# and XNA would work on it. I guess that's only the new ones eh? Bummer... it would be cool to write one of those games that... (forgetting MS's name for it) you can play on the 360, PC or Phone easily.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
lazerus
17
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 22nd Mar 2010 23:51
Quote: "(forgetting MS's name for it) you can play on the 360, PC or Phone easily.
"


XNA?

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 22nd Mar 2010 23:53
I don't think he meant XNA He mentions it on the line above.

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
jeffhuys
19
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 23rd Mar 2010 14:35
If only this could be done on the iPhone... Imagine it: DBPro on the iPhone!

You're the 'th to view this signature!
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 23rd Mar 2010 22:44
Nope, not XNA Laz

MS is in the process of / already has implemented an infrastructure that allows some XBLA games to be played cross platforms. I just forget the name for it. I'm not even sure what to google for it.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
Darth Vader
20
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 24th Mar 2010 02:12
Quote: "If only this could be done on the iPhone... Imagine it: DBPro on the iPhone!"
Not to long ago Jeku was interested in dabbling into this (At least I think it was Jeku) but imagine the work load!

RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 24th Mar 2010 15:38
Well Ive made some progress:

- In the previous version, the system relied on the .x model being exported with a texture applied to it, that it would then strip from the .x file and reapply in the engine. Ive changed it to accept non-textured objects, and added in a textureObject command that can be called afterwards to apply a texture separately.

- After some trouble remembering my trig from highschool, I managed to get the moveObject command working. It works the same way DB's version does, in all 3 axis.

- Added a colorObject command.

- Modified my position / rotation / scale object commands to accept an optional "increment" parameter. This is pretty usefull. If you set increment to true, the object's will instead add the specified xyz values to their current xyz values, instead of overwriting them. So to make a 3D object spin on it's y axis each loop, you'd just call:

Syntax: rotateObject(object, x angle, y angle, z angle, increment[optional])

rotateObject(1, 0, 0.2, 0, true)

- Originally I had to use a command-line call to the mesh converter console application to convert a .x model to a .md3dm model. I wrote up a simple program that lets you browse for any .x model, and it will take care of converting it and placing it in the original model's directory. Just a bit nicer to use than having to worry about typing Dos commands every time I need to add a new model.

- Cleaned up all of the code a bit more.

Im almost at a point where Im ready to start making some test games. Either tonight or tomorrow Ill take a few videos of some simple programs in action just to give an idea of what Ive come up with. I basically just need to implement a few camera commands (moveCamera, pointCamera, etc. ), and a simplified objectCollision command (right now I have an intersectObject command, but Id just like to have box and sphere collision commands implemented as well for simpler games that don't need to be so precise). Oh and get D3DText working, havent tried that yet still. But overall none of those things are too complicated.

The complicated stuff comes after :/ animated objects (doubt Ill even be able to get that going), databases, GPS... yikes.
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 25th Mar 2010 08:37
Great stuff, looking forward to seeing it, especially as I have the same WM phone.

Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Mar 2010 06:33
DBPro on the iPhone would never happen. For starters, DX would never be supported or emulated. It simply wouldn't have the memory to run something like Wine to support DX. Even if it did, there wouldn't be any memory to run anything at that point. Besides, OGL is better.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Mar 2010 06:42
I am amazed Ruccus, can't wait to see it in action.

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 26th Mar 2010 15:37
Just to clarify... I didnt say I wrapped DBP to the Windows Mobile Phone... I said Im simulating DBP's commands. Im just wrapping DX into an engine for phones using visual basic, the only thing DBP has to do with it is the fact that Im creating many similar commands to DBP's (textureObject, moveObject, sprite, etc. ), with the added benefit of me being able to write some of DBP's commands better (things like how the object creation commands require you to specify an object number, rather than just returning the object number it uses to create the mesh, for example).

I plan on moving over to the iPhone next year, and using xCode to develop a similar engine using the iPhone's 3D api instead of dx.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 26th Mar 2010 16:27
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 26th Mar 2010 22:23
Quote: "DBPro on the iPhone would never happen. For starters, DX would never be supported or emulated. It simply wouldn't have the memory to run something like Wine to support DX. Even if it did, there wouldn't be any memory to run anything at that point. Besides, OGL is better. "


Actually it's quite possible to "simulate" DBP on the iPhone using OGL. It would more or less be a BASIC on the iPhone, but technically it can be done.


Senior Web Developer - Nokia

Login to post a reply

Server time is: 2025-05-24 22:17:48
Your offset time is: 2025-05-24 22:17:48