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 1.0 Final; a Python port of Ultimate 3D
Topic Started: Dec 28 2009, 10:54 PM (2,111 Views)
Sothh
Member Avatar
Shaman Of Time
[ *  *  *  *  *  * ]
Gandalf20000
Jan 13 2010, 12:33 AM
Crap! I can't use it. Every time I try to run an example, it can't find the U3D DLL, which is in the site-packages directory. I have PyGame and Psyco installed, too, and Python 2.6 (no other versions).
Did you use the installer? I did, and mine works fine.
If you had my mind, you could rule the world...
Posted Image

Posted Image

My website:
Immortal Gaming

Proud to be a Communist living in the U.S.A
Offline Profile Quote Post Goto Top
 
Aragon
Member Avatar
Elite Member
[ *  *  *  * ]
yes i did.
Posted Image
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
Sothh
Jan 12 2010, 07:28 PM
I am having a problem with the shadows.

When the shadows LoD is set to 0 everything looks fine, but if I change it to 1 or higher the shadow stretches into lines.

What gives?
Are you referring to the sphere model in the Basic Example? Yeah, I noticed that LoDs created for it look extremely weird :D . I guess totally round shapes like these give the LoD creation algorithm a really hard time, as it can't find any shape-defining edges. As a result of their weird geometry, these LoDs probably cannot be optimized correctly for shadow casting (because they contain three-sided edges).


@Gandalf20000 and Aragon: the thing is, that Windows needs to find the Ultimate3D.dll, not Python. The way I programmed it, the Python root folder needs to be in the Windows path, which you can check by typing "path" in a command console. It might be missing, depending on how Python got installed on your machine.
I think I can easily fix that, though.

For now, either add the Python root folder to your Windows path manually, or add the Ultimate3D.dll to the folder of the example you want to run; it should work then.


The problem with the mouse not responding in fullscreen, as reported by FaTaL_N00B, seems to be caused by the PyGame cursor being hidden. To get rid of the cursor in that case, it can be made transparent without hiding it. To this end, the PyU3D.Mouse class will have a new setCursor(...) method that allows you to set a custom image for the PyGame cursor (it basically wraps pygame.set_cursor(...)); the transparent cursor will be used if you pass None to it.
Because of this potential problem, the cursor is no longer hidden by default, so you will now have to call mouse.setVisibility(False) at the start of your game if you want it to be hidden.
For me personally, making the cursor transparent doesn't really work, as I get a flickering square at the mouse position. So you will have to experiment to find out what works best for you.
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
meanmrmustad
Member Avatar
Elite Member
[ *  *  *  * ]
yay!

Now change u3d's d3d to OpenGL and port the damn thing to linux!

come on!
Police chief wiggum: Put out an A.P.B on Uosdwis R Dewoh, better start with greek town!

Detective: Thats Homer J Simpson chief! You're reading it upside down.

Police chief wiggum: Err.. cancel that A.P.B! But err bring back some of them errm giro's!

Detective: Eh, chief.. You're talking into your wallet!
Offline Profile Quote Post Goto Top
 
Aragon
Member Avatar
Elite Member
[ *  *  *  * ]
still doesn't work:S
Posted Image
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
Aragon
Jan 17 2010, 10:51 PM
still doesn't work:S
Have you tried putting the Ultimate3D.dll inside the Collision Example folder?

If so, what error message are you getting?

Also, how do you run CollisionExample.py? You should not run it from inside an editor, but from a command console, where the DOS prompt should show the path to the example, something like this:
Code:
 
C:\PyU3D v1.0 Beta\Collision Example>
Then type "python CollisionExample.py" and press <Enter> (you can leave out "python " if .py files are associated with python.exe).
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Sothh
Member Avatar
Shaman Of Time
[ *  *  *  *  *  * ]
MysteriXYZ
Jan 18 2010, 06:20 PM
Aragon
Jan 17 2010, 10:51 PM
still doesn't work:S
Have you tried putting the Ultimate3D.dll inside the Collision Example folder?

If so, what error message are you getting?

Also, how do you run CollisionExample.py? You should not run it from inside an editor, but from a command console, where the DOS prompt should show the path to the example, something like this:
Code:
 
C:\PyU3D v1.0 Beta\Collision Example>
Then type "python CollisionExample.py" and press <Enter> (you can leave out "python " if .py files are associated with python.exe).
I run it from the editor and it works fine.
If you had my mind, you could rule the world...
Posted Image

Posted Image

My website:
Immortal Gaming

Proud to be a Communist living in the U.S.A
Offline Profile Quote Post Goto Top
 
zelda4evr
Member Avatar
Left hook, Jab. Left hook, Jab.
[ *  *  *  *  *  * ]
I just double click mine ;)

Posted Image
Posted Image
Need something made?
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
@Sothh and zelda4evr: you are both missing the point. Sure you can run your program like that, as long as there are no errors. But if there are, you either won't get info about what went wrong (if you double-clicked the .py file, the console window will disappear so you won't catch the error message), or the program window will stay open (if you ran it through an editor) until you close the editor itself (some editors like IDLE and PyScripter don't work well with GUI programs).

So while bug-testing, it's better to use a command console.
BTW, you can get rid of the console window for a stable, final version of your program, by changing the .py extension to ".pyw".
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
zelda4evr
Member Avatar
Left hook, Jab. Left hook, Jab.
[ *  *  *  *  *  * ]
Well for me I usually know exactly where my errors are so its not that big of a deal, and if I really want to read the error I just hit print screen when it pops up, just like I did earlier in the topic.

Posted Image
Posted Image
Need something made?
Offline Profile Quote Post Goto Top
 
Electricity
Chaos vs. Cosmos
[ *  *  *  * ]
When i try to run the Basic Example it gives me an error about psyco being for the wrong version...

I have installed the following:
Python 2.6
PyWin32 for 2.6
PyGame for 2.6
Psyco for 2.5 and up

If i remove/comment the lines:
Code:
 
import psyco
psyco.full()

Then the program runs :thumb_up: but i would really like to see the psyco in action :rolleyes:


Edit: Nevermind I found a Psyco for 2.6 :P it all works fantastic! great work MystriXYZ
Edited by Electricity, Feb 7 2010, 03:05 PM.
Offline Profile Quote Post Goto Top
 
Sothh
Member Avatar
Shaman Of Time
[ *  *  *  *  *  * ]
I have tried it with and without Psyco and the FPS stayed the same (With unlimited FPS limit).
If you had my mind, you could rule the world...
Posted Image

Posted Image

My website:
Immortal Gaming

Proud to be a Communist living in the U.S.A
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
@Electricity: Glad to hear it works for you. Have fun with it :) .

@Sothh: Psyco optimizes (compiles) the Python code only, it does not affect the performance of Ultimate 3D in any way. As such, the speed of the Basic Example probably won't change a lot with or without the use of Psyco, since not much Python code is involved. But on my system, Psyco does improve the framerate by around 100 fps (from 520 to about 620) for the Collision Example, which uses a lot more Python calculations.
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Gandalf20000
Member Avatar
Enormous DirectX Newbie
[ *  *  *  *  *  * ]
MysteriXYZ
Dec 28 2009, 10:54 PM
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 ?
That reminds me of rotations in DirectX:
Code:
 
D3DXMATRIX matRotationY; //the rotation transform matrix for the y axis
D3DXMATRIX matRotationZ; //the rotation transform matrix for the z axis
static float index; index+=.1;

D3DXMatrixRotationY(&matRotationY,
index);
D3DXMatrixRotationZ(&matRotationZ,
sin(index));

d3ddev->SetTransform(D3DTS_WORLD,&(matRotationY*matRotationZ)); //set the rotation


You can multiply transformations together (in fact, to get them to work right, you have to), even translations and scalings, I think.

EDIT: Oh yeah, and even the order you multiply in matters, because you're multiplying matrices, rather than ordinary numbers. If you multiply the rotation first by a translation, you have a model spinning in place at the translation point. If you switch the order, you have an orbiting model.
Edited by Gandalf20000, Feb 21 2010, 09:27 PM.
Posted Image
Offline Profile Quote Post Goto Top
 
Sothh
Member Avatar
Shaman Of Time
[ *  *  *  *  *  * ]
Ignore this.
Edited by Sothh, Feb 23 2010, 11:14 PM.
If you had my mind, you could rule the world...
Posted Image

Posted Image

My website:
Immortal Gaming

Proud to be a Communist living in the U.S.A
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Announcements · Next Topic »
Add Reply