Thanks, now its clear to me, I think I’ll use box then.
Does NxPanda work with the newest Panda3D 1.4.2?
Hi weihuan, it works here, I’m using NxPanda with Panda3D 1.4.2.
Thank you for inform me Cronos.
After quite some time: here is the second release of NxPanda (0.2)
http://www.dachau.net/users/pfrogner/NxPanda.zip (996776 byte)
The code has been rewritten from scratch, with focus on stability and memory leaks. Also some new features have been added:
- force fields
- joints
- serialization (xml or binary)
- cloth simulation now with texture support
- fluid simulation and fluid emitters/drains
- soft body simulation (unfinished)
- hardware accelerator support
Source and binaries are included. Binaries have been compiled for Panda 1.4.2
using VC++ 8.0 and Python 2.4.
There are still some kinks and edges. For example I really should check if filenames passed as arguments are valid. Suggesting, criticism or bug reports are welcome, as always.
enn0x
That is wonderful news, and thx so much for taking the time to make this happen for all Panda3d’ers
)
Cheers and Merry Christmas everyone…may the reason for the season uplift us all ![]()
cu
nl
Very cool the samples and new features! Thanks enn0x
what is the state of PhysX for linux? And what licensing restrictions we have on using it?
I would like to know this too… I don’t know how to build from the source to run in Linux ![]()
About the licensing restrictions, there is a License.txt in the .zip, see if it helps.
I think these questions are about NxPanda. PhysX (tm!!!) is a first-grade physics engine developed by AGEIA. First-grade means that it is on the same level as Havoc. A PhysX SDK for Linux is available from the AGEIA site (link is above), for registered users.
NxPanda is a (not really first grade
wrapper around PhysX written by me. For my own work the zlib license applies. For the underlying PhysX engine the AGEIA license applies (link is above too).
In short and as far as I understand the AGEIA license:
- royalty free for commercial and non-commercial use
- have to register with AGEIA
- have to give attribution to AGEIA technology (readme.txt, intro screen, …)
- not allowed to reverse-engineer AGEIA binary code etc
- not allowed to distribute any documentation, samples or other material that is copyrighted by AGEIA
But please read the AGEIA license yourself, I’m not a lawyer and can’t give legal advice here.
About Linux: I am pretty optimistic that NxPanda can be compiled on Linux. But I don’t have a Linux computer available. Getting Linux, setting up a machine, getting familiar with building on Linux and so on will require me two or three days. So I am afraid there won’t be Linux support if not someone else gives it a try.
The basic steps for building:
- install PhysX SDK for Linux
- install scons (just an ordinary Python module)
- edit the NxPanda SConstruct file (adapt paths and compiler flags)
- run “scons”
enn0x
oh, that feels like xmas(s) for me 
thx a lot 
Hi Ennox.
In case you don’t need a compiler guru I might try to take a look at it.
I could also set up a linux machine for the compiler stuff where both could have a look at in the case of problems.
In case you would want to spend some time with compiling problems on linux there might be a solution. Lemme know its that of interest. 
Regards, Bigfoot29
Than you for your offer, bigfoot29.
I am interested, but it won’t be before 3/2008 until I can come back to it. Also I have a spare PC by now, which I could turn into a dual boot machine. Which flavour of Linux (SuSe, RedHat, …) would be best to go for?
enn0x
Well, about the date: doesn’t matter that much to me. 
I would like to suggest to put SuSe into the trashcan - since its only a local phenomenom (and is rather bad imho)
Due to the fact that I use an Debian based OS (Ubuntu), I am pro-Debian. Other users might suggest Red Hat or whatever, but thats a matter of taste.
However, I do NOT suggest using an bleeding edge Linux since many other (not-so-top-notch) distributions might not be able to use the binaries (due to missing libraries / older versions) then.
Regards, Bigfoot29
i am trying to compile NxPanda with scons in VS8.
i did it like you described in the Readme.txt.
now i have a “NxPanda.dll” and “NxPanda.pyd” which are both ~1.6 mb.
the original dll (named NxCharacter.dll) is about 140kb.
after replacing NxCharacter.dll with NxPanda.dll and NxPanda.pyd, panda can’t load the dll.
can you please give me a hint?
greets
Sure. I try to explain.
(1) “NxPanda.pyd” is just a renamed copy of “NxPanda.dll”. Both are the same files. I have choosen to change the extension to .pyd in case Python 2.5 users want to use it. Python 2.5 doesn’t find .dll wrappers without some tricks.
(2) “NxPanda.pdy/.dll” is the Python wrapper file. the one you load from Python. But the wrapper dynamically loads “NxCharacter.dll”. So it requires to find “NxCharacter.dll”. “NxCharacter.dll” is a pure C++ DLL (distributed by AGEIA as part of the PhysX SDK).
(3) You must have two libraries to use NxPanda:
- first: either “NxPanda.dll” or “NxPanda.pyd”
- second: “NxCharacter.dll” in the same directory as the first.
enn0x
ok thanks.
another question: i am trying to make a tearable clothobject, therefore using your cloth.py example code and adding the tearable-flag and tearfactor.
clothDesc = Nx.NxClothDesc( )
clothDesc.globalPosition = pos
clothDesc.thickness = 0.25
#clothDesc.density = 100.0
clothDesc.bendingStiffness = 1.0
clothDesc.stretchingStiffness = 1.0
clothDesc.dampingCoefficient = 1.0
clothDesc.friction = 0.5
clothDesc.tearFactor = 8.0
#clothDesc.attachmentResponseCoefficient = 1.0
clothDesc.flags |= Nx.NX_CLF_BENDING
clothDesc.flags |= Nx.NX_CLF_COLLISION_TWOWAY
clothDesc.flags |= Nx.NX_CLF_TEARABLE
but that doesn’t work.
any suggestions please?
Hmm… tearable cloth doesn’t work so far. Tearing a cloth will change the number of vertices/normals/texcoords etc. of the cloth mesh. This is usually done by allocating (yes, we are on the C level) buffers with enough “spare” vertices for tearing, for example 2x the number of original vertices.
There are several other problems with cloth and soft body so far. For example that I don’t update the nodes bounding box. I have been thinking about a new way to provide PhysX support for some time now (e.g. deriving cloth from PandaNode --> ClothNode), but this would be a redesign starting from zero. Right now I am missing time for such a project.
I suggest sticking to the “core” objects for now, which I hope a stable enough for usage. Sorry for the bad news.
enn0x
hi enn0x,
first of all, thanks for sharing your work, this helps me alot for my panda-rendered physics project 
as i need softbodies, i tried your example with the ageia froggy model and it works! but its very slow (compared to ageia samples) and i guess it hast to do with how the mesh information is passed from physx to panda?
do you have any clue what the problem could be? if you have any hint i can take a look at it myself (as i already read through the c++ nxpanda code and i think i understand whats going on there)
if you want to somehow get feedback of bugs i’ve found or about stuff i add to your bindings please tell me…
greetings
β
Well, first the demo code that comes with NxPanda doesn’t render the soft body. I think I never tried this before. It just shows a debug render of the mesh. If you turn off the debug renderer then the framerate should go up.
The debug renderer is freaking slow, because it creates a new LineSegs NodePath each frame, by adding one line segment after the other.
def renderDebug( self ):
if not self.debug: return
dbg = self.scene.getDebugRenderable( )
segs = LineSegs( )
for p0, p1, color in dbg.getLines( ):
segs.setColor( *color )
segs.moveTo( p0 )
segs.drawTo( p1 )
self.debugNP.removeNode( )
self.debugNP = render.attachNewNode( segs.create( ) )
The AGEIA demos do this loop in C++, and so they are faster.
Another reason why rendering cloth and soft bodies in Panda3D will be slower than the AGEIA demos: The “visible” mesh has to creates each frame (on the C++ layer), by reading the vertex/tex coord/normal buffers that PhysX creates and write them to a Panda3D mesh using GeomVertexWriter. The AGEIA demos just pass the complete vertex etc. arrays to OpenGL with one function call. This makes them faster too.
Panda3D users have to stick to GeomVertexWriter, and add vertex after vertex in a loop. This is slower, but on the other hand Panda3D can use OpenGL and DirectX.
Well, would be interesting if sonthing like these calls can be used for Panda3D too, perhaps using GeomVertexArrayData. This could give a huge speedup for cloth and soft body.
glVertexPointer( 3, GL_FLOAT, sizeof(buffer), buffer );
glNormalPointer( GL_FLOAT, sizeof(buffer), buffer );
enn0x