Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
PyU3D; a Python port of Ultimate 3D
Topic Started: Dec 28 2009, 10:54 PM (1,242 Views)
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
Hi people :) ,

At last, I can make an announcement I've wanted to make for quite some time now...

It's my 1000th post :yahoo: :yahoo: !!!!!!








Errmmm.... well it would be a bit daft if THAT was the great announcement, right :rolleyes: ?

Anyway, it's nice that I'm able to use this post for a momentous occasion :D .

Have I got a present for you guys :mad: !

To some, it's not really a surprise, but that shouldn't spoil the fun you're gonna have with this :music: .

For months now, I've been working on and off on something that more and more members here seem to become interested in:
a port of Ultimate 3D to a real programming language; one that is easy to learn and quite powerful at the same time.

Guys and gals, I am extremely proud to introduce to you:

PyU3D

Yes my friends, a Python port of Ultimate 3D is now a reality!!!! :yahoo: :yahoo: :yahoo:


So yeah: Python. Some of you don't like it, and that's fine by me. You prefer C++? Good for you. Let me say this very clearly, and don't make me repeat myself:

DIFFERENCES BETWEEN PYTHON AND C++ WILL NOT BE DISCUSSED IN THIS TOPIC.
So no comments like "C++ is so much better!", "Python sucks!" etc.

I hope that's understood ;) .


Not everything is documented yet, but it shouldn't take long (sometime after NewYear, gonna take a break now) to finish the user manual , which you will soon be able to lay your eyes upon.
It is this manual that has been taking up most of my time, because I want it to be very, very complete and easy to navigate (it's very "link-oriented" :D ).


So how should you approach PyU3D?

The first thing I want you to do is: FORGET EVERYTHING. No, not your good manners or things like that, but all about the way you worked with U3D in GM.

Then go and learn Python, if you haven't already. Because, yeah, this is about programming, dudes and dudettes, not about any of that drag'n'drop nonsense :D !

Reading the PyU3D documentation is extremely important, because the way I ported U3D is radically different from the GM version - but in a very nice way, so don't panic ;) .


And why is PyU3D so great? Ahhh, where shall I start?


  • Faster than GM, obviously. Included in the download is a PyU3D version of the Collision Example, so you can compare it with the GM version.
  • No need to have the Ultimate3D.dll in every single project folder; since it's installed in the PyU3D package folder (which is where PyU3D looks for it, when it can't find it in the project folder), you don't need to copy it over and over again.
  • Mouse control: ALL buttons, including the wheel, can be used.
  • It's OOP! Just about everything is wrapped in classes, even abstract things, like rays and swept ellipsoids!
  • No more messing around with integer indices; numbers are the little gremlins that do all the hard work behind the scenes, and should remain hidden ^_^ .
    For example, you don't have to associate a texture with a hard-to-remember index anymore; instead, you create a Texture object and work with that.
  • Much improved flexibility when doing vector & matrix math.
  • Things that seemed very complicated, like model manipulation (meshes are now locked AUTOMATICALLY - what a timesaver!) and the portal engine (there's only ONE method to set room visibility - no more "visibility enforcement") are a lot easier to understand and use now.
  • Everything is much more consistent. Things that are similar or somehow related, can effectively be used in the same way (mostly because they inherit from the same baseclasses).

And probably more things.


There are a couple of highlights that I'd like to draw your attention to specifically.


As already mentioned, rays and swept ellipsoids are now objects. They inherit from the PyU3D.Transformable baseclass. This means you can transform them through exactly the same methods as cameras, primitives or models. This is quite nice, but it gets better.
You see, that PyU3D.Transformable baseclass has a nice little method called "alignTo()". Need I say more, my friends :D ? Well actually, I do. That little method is extremely powerful, since you can adjust alignment of two objects in many ways. First of all, you can set which kinds of transformation (translation, rotation and/or scaling) get involved in the alignment process. As if that wasn't enough, you can even supply different smoothing factors for each of these types of transformations; think of the "flexible camera" technique, but with more control and now available for EVERY transformable object :king: !!
If you think about it, you can create amazing constructions, made up of objects that are all aligned to each other in different ways :) .


And now we get to my favourite subject: *all together now* vectors and matrices :lol: !

First off, the math functions in PyU3D are my own implementation. These replace the external .dll functions, which leads to an important performance increase.

There is now an additional type of matrix: the AxisRotationMatrix B) .

Doing arithmetic with vector and matrix objects is now as easy as doing calculations with numbers (thanks to operator overloading). Let me give you a small example:

in GML:
Code:
 
vect=CalculateCrossProduct(-1,vect1,vect2);
scalar=2.7*CalculateDotProduct(vect1,vect2);
CalculateVectorScalarProduct(vect,vect,scalar);
matr=TransformMatrix(-1,matr1,matr2);
TransformMatrix(matr,matr,matr3);
InvertMatrix(matr,matr);
TransformVector(vect,vect,matr);
y=GetVector(vect,2);

a typical one-liner in PyU3D:
Code:
 
y = (vect1 ** vect2 * 2.7 * (vect1 * vect2) * ~(matr1 * matr2 * matr3))[1]

Now isn't that just absurdly easy :P ?


Not only are matrices much easier to use in PyU3D than in GML, you can also do more with them.
The next best thing after sliced bread is definitely sliced matrices. No kidding.
Ever wanted to keep only the rotation of a general transformation matrix? Do this:
Code:
 
rot_matr = matr[1]

Want to get rid of the scaling? There it goes:
Code:
 
move_rot_matr = matr[:2]

Rotations turn your stomach upside down? Eat this:
Code:
 
move_scale_matr = matr[::2]
Yummi :P !




Now venture forth into the realm of PyU3D, and let us usher in a new era:

an era without GM :music: !!!!
Well a guy can dream, right :whistle: ?

Oh yeah, below is the download link :P :

DOWNLOAD PYU3D

Once everything required for PyU3D is installed (see the User Manual), the examples can be run from any location.


And now I'd like to hear what you think. Is it a mess? Or a success? You decide.


- MysteriXYZ


I R Python-Powered :ph43r: !!!
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Reikyrr
Member Avatar
-
[ *  *  *  *  *  * ]
-135796
W00T
Wow nice! :thumb_up: (still too bad you didn't port it to c++ instead)
Im testing it out now.
|R03l0R<|>R3ikyrr|
I am my own daugter,
and I'm my daugters son.
Online Profile Quote Post Goto Top
 
Gandalf20000
Member Avatar
DirectX Newbie
[ *  *  *  *  *  * ]
Sorry I was so bad at keeping the secret, Mysteri, but at least I never said your name! :P
Online Profile Quote Post Goto Top
 
Despellanion
Member Avatar
The Black Curtain
[ *  *  *  *  *  * ]
Gandalf20000
Dec 28 2009, 11:23 PM
Sorry I was so bad at keeping the secret, Mysteri, but at least I never said your name! :P
Told you :P You didn't even have had to try to keep it a secret, it was so obvious anyway ;)
Great job MysteriXYZ :thumb_up:
Posted Image

It's an MMORPG, you rtard!



Offline Profile Quote Post Goto Top
 
Reikyrr
Member Avatar
-
[ *  *  *  *  *  * ]
*cough*he made despallanion say it*cough*

I knew you where working on it.

I hate to spoil the party but after installing active python it still doesnt work.
Or do I need an older version of active python?
|R03l0R<|>R3ikyrr|
I am my own daugter,
and I'm my daugters son.
Online Profile Quote Post Goto Top
 
Synexn-Prime
Member Avatar
Sierra Prime GF32 : Unit 7
[ *  *  *  *  *  * ]
Quite interesting how it seemed everybody already knew. Nice to see it finally working.
Synexn-Prime, the Bigger Sister. Prepare to watch her fly.
Watch that tear shatter the steel. 2012.
Posted ImagePosted Image
Current Stone: Water : Prepare to help her survive. June 2010.
formerly known as skarik
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Sounds great... but what doesn't sound great is mediafire... Its being a pain.
Any chance of a mirror? :)
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Synexn-Prime
Member Avatar
Sierra Prime GF32 : Unit 7
[ *  *  *  *  *  * ]
Linkin
Dec 29 2009, 01:50 AM
Sounds great... but what doesn't sound great is mediafire... Its being a pain.
Any chance of a mirror? :)
Of course.

Box.net: http://www.box.net/shared/h33oztqmi8

Would you mind if I base a current project of ours off of your alignTo idea?
Edited by Synexn-Prime, Dec 29 2009, 02:48 AM.
Synexn-Prime, the Bigger Sister. Prepare to watch her fly.
Watch that tear shatter the steel. 2012.
Posted ImagePosted Image
Current Stone: Water : Prepare to help her survive. June 2010.
formerly known as skarik
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Thanks
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
The Black Curtain
[ *  *  *  *  *  * ]
I would really like to try this out, but I have yet to find a decent Python editor. And making executables seems to be virtually impossible without some "hacking".
Edited by Despellanion, Dec 29 2009, 08:26 PM.
Posted Image

It's an MMORPG, you rtard!



Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
Despellanion
Dec 28 2009, 11:39 PM
Great job MysteriXYZ :thumb_up:
Thanx, man :) . Maybe you'll want to use it someday for a new project ;) .
Despellanion
 
I would really like to try this out, but I have yet to find a decent Python editor.
Have you tried PyScripter already? It's made in Delphi, so you should definitely like it :D .
Despellanion
 
And making executables seems to be virtually impossible without some "hacking".
Try GUI2exe; it works for me. I might make a tutorial about that later.


Gandalf20000
Dec 28 2009, 11:23 PM
Sorry I was so bad at keeping the secret, Mysteri, but at least I never said your name! :P
Nah, you did well, considering the circumstances ^_^ . And you're the second one in this topic to reach a posting milestone :D .


Reikyrr
 
I hate to spoil the party but after installing active python it still doesnt work.
What do you mean, "it still doesnt work"? When are people going to learn that a statement like that is meaningless without additional information :rolleyes: ? Please tell me, WHAT doesn't work: the installation of PyU3D, or running the examples? Do you get an error message? What does it say? Etc., etc., etc.
Reikyrr
 
Or do I need an older version of active python?
Again, I can't answer that if you don't tell me what version you DID install. So I will guess you installed ActivePython 3.x, which is indeed not supported. It might work anyway, but I can't check since I don't use it myself. The reason for this, is that PyGame - which is the host program I use for Ultimate 3D - still doesn't fully support Python 3.x either.
I recommend that you install ActivePython 2.6.x (make it the default Python version if you want to keep 3.x), and make sure the other required components are also installed.

If you're still not able to run the examples, open a DOS prompt and run it from there; if an error occurs then, at least you will see an error message, revealing the cause.


Synexn-Prime
 
Nice to see it finally working.
Thank you, venerable members of the Synexn Collective :D (also for the mirror). So you have actually managed to install and run it?

Synexn-Prime
 
Would you mind if I base a current project of ours off of your alignTo idea?
Go right ahead - and if you want more details, one of you guys can send me a PM :P .
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Nazle
Member Avatar
Student Professional Accountant at day break ]||[ Extreme Gamer when darkness falls...
[ *  *  *  * ]
AWESOME!!! I gatta get my laptop fixed sooner! :yahoo:
Edit: How did I do with the secret?
Edited by Nazle, Dec 30 2009, 03:31 AM.
Posted Image

Nazle Screen Play Entertainment


Skarik is not human... He's ORANGE!
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
This is old news to me, but it looks like you've done some good work :) . Congratulations on bringing this port to a complete state. Having created the original interfaces I know how much work it is. I would be glad to see this port make members move from Game Maker to Python. The interfaces you have created look good indeed. The inheritance structure is reasonable and useful and the documentation looks good. One thing you may change in the documentation is to set up a different color for clicked links. This is useful as it lets you see which links have never been clicked.

This project has potential. Python code executes a lot faster than GML. This makes it possible to add low level features to the engine. For example you may implement your own scene manager with an octree to optimize collision detection and culling in big scenes. Besides there are many good libraries available for Python. It would be interesting to link PyU3D to some open source physics engine to make it become a more complete game development solution. Another interesting project would be to port the Tech Demo to PyU3D. This would give you some numbers to prove that PyU3D is a lot faster than Ultimate 3D for Game Maker.

Let me know if you want PyU3D to get its place on Ultimate3D.org. I may give it its own sub category in the downloads section or something like this.
Offline Profile Quote Post Goto Top
 
ashrat3000
Member Avatar
u3d raytracer
[ *  *  *  *  *  * ]
Dr. Best
Dec 30 2009, 04:04 AM
Let me know if you want PyU3D to get its place on Ultimate3D.org. I may give it its own sub category in the downloads section or something like this.
Now what happened to not supporting U3D 2.x in anything other than GM eh?
:D

그대를 사랑해


Offline Profile Quote Post Goto Top
 
Aragon
Elite Member
[ *  *  *  * ]
:cow: :yahoo: :clapping:

add a sub category for this, Dr, Best

I cant run:S
i downloaded Pyscripter, and he says, when i run:

Code:
 
IOError: The Ultimate3D.dll is missing. Please make sure it can be found in '<Python folder>\Lib\site-packages\PyU3D'

Yes i'm a noob:)
Edited by Aragon, Dec 30 2009, 11:48 AM.
waiting for skarik's collision with terrain (physics)
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Announcements · Next Topic »
Add Reply