3-D character

42 views
Skip to first unread message

chris

unread,
Mar 3, 2011, 10:27:42 PM3/3/11
to PYGGEL-dev
is it possible to put multiple sprites from a sprite sheet together in
a kind of cube to make a 3-d char? also how do i make it so that the
image does not turn when the camera is rotated?

RB[0]

unread,
Mar 3, 2011, 10:36:15 PM3/3/11
to PYGGEL-dev
Wow, I'm honestly surprised anyone is still using this, I haven't even
looked at the code in... years :S
I can't recall if cubes allows a list of textures, or if you'll just
have to make a spritesheet texture for it that "wraps" around.
Oh I see that is what you plan to do. You can have a texture "wrapped"
around a cube, instead of just repeated, that's what the skybox
examples do. Cubes have the same functionality, so the best thing I
can suggest would be to look at the classes/syntax and try and do the
same thing in the cube's...
It depends - the cube class itself does not support this, however the
sprite classes do. What they do is simply inverse the camera rotation
after moving - you could create a custom cube class (or modify the
standard one) that simply does the same thing.

Everything I am suggesting does require some digging around in the
code. Sadly I have been extremely busy for a while, and haven't kept
up on this, so it is in a rather unfinished state, thus requiring more
getting to the source to make it work. Apologies :S

HTH
Matt

chris

unread,
Mar 3, 2011, 10:56:48 PM3/3/11
to PYGGEL-dev
the problem i am having is when i try to rotate the camera on the x-
axis, it is as if the other picture (the "ground") is circling the
character, which is imported as an image (not a bitmap because if i
cant do things with it i want with pygame, like set a colorkey, then
make it a bitmap in pygge). it start behind it then starts going up,
then in front of the character, then down, and back behind the
character and it starts all over again. what i want it to do is kinda
tilt the whole thing.

Ian Mallett

unread,
Mar 4, 2011, 1:10:03 AM3/4/11
to pygge...@googlegroups.com
Hi,

If you want to make a 3D object out of 2D images, your best best is to make "slices". 

Basically, you make several intersecting quads, and map your textures onto them.  The quads should lie along the cardinal planes, as here: http://4.bp.blogspot.com/_1tVZnzunf28/TQy-3SIHr_I/AAAAAAAAAI8/9ME_Pk2_KfE/s1600/geometry.gif.  Then, you'll map your 2D renderings onto these planes.  I have no idea how pyggel would handle this, of course. 

If you're making actual 3D models, you'll likely want an actual object to use.  The PyGame Cookbook has a recipe for loading .obj, which is a widely used format for 3D objects. 

Ian

chris vj

unread,
Mar 4, 2011, 9:22:05 AM3/4/11
to pygge...@googlegroups.com
hmm, ok. that is not included in the geometry of pyggel. ill look
through other things and see how, or if, i can add it

On 3/3/11, Ian Mallett <geome...@gmail.com> wrote:
> Hi,
>
> If you want to make a 3D object out of 2D images, your best best is to make
> "slices".
>

> Basically, you make several *intersecting* quads, and map your textures onto


> them. The quads should lie along the cardinal planes, as here:
> http://4.bp.blogspot.com/_1tVZnzunf28/TQy-3SIHr_I/AAAAAAAAAI8/9ME_Pk2_KfE/s1600/geometry.gif.
> Then, you'll map your 2D renderings onto these planes. I have no idea how
> pyggel would handle this, of course.
>
> If you're making actual 3D models, you'll likely want an actual object to
> use. The PyGame Cookbook has a recipe for loading .obj, which is a widely
> used format for 3D objects.
>
> Ian
>

> --
> You received this message because you are subscribed to the Google Groups
> "PYGGEL-dev" group.
> To post to this group, send email to pygge...@googlegroups.com.
> To unsubscribe from this group, send email to
> pyggel-dev+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pyggel-dev?hl=en.
>
>

RB[0]

unread,
Mar 4, 2011, 6:19:34 PM3/4/11
to pygge...@googlegroups.com
I'm still hazy as yo what you are doing...
If you simply want 3 intersecting quads you can do that in PYGGEL (just align them correctly) but I wouldn't recommend that, it's rather ugly...
Either a 2d sprite (that always faces the camera) or a mesh are your best bets in PYGGEL. sorry :S

chris

unread,
Mar 4, 2011, 7:16:30 PM3/4/11
to PYGGEL-dev
ok, im confused as to exactly what the meshes are, can someone explain
what it is and how to make one please?

On Mar 4, 3:19 pm, "RB[0]" <roeb...@gmail.com> wrote:
> I'm still hazy as yo what you are doing...
> If you simply want 3 intersecting quads you can do that in PYGGEL (just
> align them correctly) but I wouldn't recommend that, it's rather ugly...
> Either a 2d sprite (that always faces the camera) or a mesh are your best
> bets in PYGGEL. sorry :S
>
> On Fri, Mar 4, 2011 at 8:22 AM, chris vj <chrisvanderj...@gmail.com> wrote:
> > hmm, ok. that is not included in the geometry of pyggel. ill look
> > through other things and see how, or if, i can add it
>
> > On 3/3/11, Ian Mallett <geometr...@gmail.com> wrote:
> > > Hi,
>
> > > If you want to make a 3D object out of 2D images, your best best is to
> > make
> > > "slices".
>
> > > Basically, you make several *intersecting* quads, and map your textures
> > onto
> > > them.  The quads should lie along the cardinal planes, as here:
>
> >http://4.bp.blogspot.com/_1tVZnzunf28/TQy-3SIHr_I/AAAAAAAAAI8/9ME_Pk2...
> > .

Ian Mallett

unread,
Mar 4, 2011, 7:18:52 PM3/4/11
to pygge...@googlegroups.com
On Fri, Mar 4, 2011 at 5:16 PM, chris <chrisva...@gmail.com> wrote:
ok, im confused as to exactly what the meshes are, can someone explain
what it is and how to make one please?

chris

unread,
Mar 4, 2011, 7:46:31 PM3/4/11
to PYGGEL-dev
ok um anyone willing to make some person meshes for me please? we
could work out some kind of agreement, i am not good with art,
definitely not 3-d art.

Ian Mallett

unread,
Mar 4, 2011, 7:47:22 PM3/4/11
to pygge...@googlegroups.com

chris

unread,
Mar 4, 2011, 7:50:45 PM3/4/11
to PYGGEL-dev
um i was actually looking for something free, and i could do
something, dunno what, anything you can think of that i can do, in
return

On Mar 4, 4:47 pm, Ian Mallett <geometr...@gmail.com> wrote:
> http://www.turbosquid.com/

Ian Mallett

unread,
Mar 4, 2011, 8:00:16 PM3/4/11
to pygge...@googlegroups.com
turbosquid has tons of free models of pretty-much anything.  For example, you mentioned characters?  The first 97 models you get for "People" are free. 

Also check 3dstudio too.  It seems to have a better selection of characters.  The first 148 are free. 

These people are artists; it's their job to make models, so granted, there are some not-free ones.  In any case, generally speaking, they're much better than programmers (including myself). 

chris

unread,
Mar 4, 2011, 8:12:01 PM3/4/11
to PYGGEL-dev
ah, i went to the characters section and all i saw was $50+ ones

On Mar 4, 5:00 pm, Ian Mallett <geometr...@gmail.com> wrote:
> turbosquid has tons of free models of pretty-much anything.  For example,
> you mentioned characters?  The first 97 models you get for
> "People<http://www.turbosquid.com/Search/Index.cfm?keyword=people&x=0&y=0>"
> are free.
>
> Also check 3dstudio <http://www.the3dstudio.com/> too.  It seems to have a
> better selection of
> characters<http://www.the3dstudio.com/product_search.aspx?level=1&search=charact...>.
> The first 148 are free.
>
> These people are artists; it's their job to make models, so granted, there
> are some not-free ones.  In any case, generally speaking, they're much
> better than programmers (including myself).
>

chris

unread,
Mar 4, 2011, 8:14:15 PM3/4/11
to PYGGEL-dev
ok, so to add clothes to the models, would i need clothes meshes too
and how would it work? ty for all the help

Ian Mallett

unread,
Mar 4, 2011, 8:54:04 PM3/4/11
to pygge...@googlegroups.com
On Fri, Mar 4, 2011 at 6:14 PM, chris <chrisva...@gmail.com> wrote:
ok, so to add clothes to the models, would i need clothes meshes too
and how would it work?
Yes; same as before.  You should probably just make it yourself, or make a deal with an artist or something.  If you want to simulate/animate it (like so it looks realistic), you'll need something a lot fancier.  I wrote a CPU cloth implementation, and there's a GPU one in my glLib, both on PyGame.org.  This is getting really complicated though. I recommend taking it slowly.  You'll find that getting a moving character walking around a screen is enough of a challenge.

chris

unread,
Mar 4, 2011, 9:07:30 PM3/4/11
to PYGGEL-dev
ok i looked it your( i think its yours, http://www.pygame.org/project-Realtime+CPU+Cloth-1235-.html)
cloth implementation. im not truly sure how i would use this, it seems
to just be points of light that can be moved

chris

unread,
Mar 4, 2011, 9:22:53 PM3/4/11
to PYGGEL-dev
also, the mesh i downloaded is gmax :| how do i convert it to OBJ? the
3-d editor i have is blender, but it cant open it

Ian Mallett

unread,
Mar 4, 2011, 9:24:28 PM3/4/11
to pygge...@googlegroups.com
I'm saying that a full cloth simulation is overkill right now--and the CPU cloth won't be fast enough for a real game.  When you have characters that need capes, dresses, or something that's not well modeled by simply drawing the clothes on your characters' body, then you can start to think about adding GPU cloth. 

Cloth simulation is a huge topic in graphics, and it's not easy at all.  Good cloth simulation (like you'd use for actual clothing) need larger meshes, perhaps 128x128.  At this scale, the cloth falls apart under its own weight because local dynamics cannot propagate to other ends of the fabric.  To solve this requires error minimization after the integration step.  This means implementing jacobi iteration, conjugate gradient, or adaptive-recursive multigrid methods to achieve sparse matrix reduction.  This is necessary to solve Poisson-coupled nonlinear systems of partial differential equations up to around (literally) a 10,000 variables.  And none of this will run fast enough on the CPU (and certainly not in Python), you'll need to write programs running on the graphics card (that's right, without a debugger) to do this. 

Anyway, I suggest making your game first, before you start adding eye-candy. 

About the object, turbosquid offers file format conversion (although perhaps not for free models; you'll have to check).  There are other programs that can open it (3D Object Converter might work).

Ian

chris

unread,
Mar 4, 2011, 9:29:46 PM3/4/11
to PYGGEL-dev
ok, so forget about clothes? or simply replace the body with them?
dont think they allow you to covert free ones

Ian Mallett

unread,
Mar 4, 2011, 9:43:15 PM3/4/11
to pygge...@googlegroups.com
On Fri, Mar 4, 2011 at 7:29 PM, chris <chrisva...@gmail.com> wrote:
ok, so forget about clothes?
Yes.
or simply replace the body with them?
Usually, you just draw the clothes on the body's texture.
dont think they allow you to covert free ones
You can always use a different model for now.  Again, making the actual core of your game is the most important part.  I can't tell you how many of my pet projects have been sidetracked, delayed, or altogether forgotten because I get too concerned about getting each tiny bit right before I move on.

What's your game about?  Implement the core of your game first.  Your people can be cubes for now. 

chris

unread,
Mar 4, 2011, 9:50:30 PM3/4/11
to PYGGEL-dev
i have not gotten the storyline yet, i am not good at writing stories
or anything similar, looking for someone to do that, i am still
working on creating the map, etc

On Mar 4, 6:43 pm, Ian Mallett <geometr...@gmail.com> wrote:
> On Fri, Mar 4, 2011 at 7:29 PM, chris <chrisvanderj...@gmail.com> wrote:
> > ok, so forget about clothes?
>
> Yes.
>
> > or simply replace the body with them?
>
> Usually, you just draw the clothes on the body's texture.
>
> > dont think they allow you to covert free ones
>
> You can always use a different model for now.  Again, making the actual core
> of your game is the most important part.  I can't tell you how many of my
> pet projects have been sidetracked, delayed, or altogether forgotten because
> I get too concerned about getting each tiny bit right before I move on.
>
> What's your game about?  Implement the core of your game *first*.  Your

chris

unread,
Mar 4, 2011, 11:33:56 PM3/4/11
to PYGGEL-dev
ok, to create a "window" with options like exit, pause, etc., should
menu, window, or some other one? am trying to use window and keep
getting a KeyError

Markus Martin

unread,
Mar 4, 2011, 9:07:11 PM3/4/11
to pygge...@googlegroups.com

I would recommend Open Game Art (http://opengameart.org). All the assets
are freely licensed. Quality varies a bit, but you should be able to
find at least some placeholders (which are better than nothing).

There are also sounds and 2D art, so all you need to make a game, just
have to write the code! ;)

Cheers,
-Markus

RB[0]

unread,
Mar 4, 2011, 11:39:13 PM3/4/11
to pygge...@googlegroups.com
Hey chris!
It's sounding more and more from what you are saying that you need more power in a 3d engine, something more like what OGRE or Panda3D offer. PYGGEL is good for prototyping and small games, but at the moment is too buggy/incomplete to handle a lot of the things you are talking about needing.
All it supports are basic, static meshes, and only low-poly ones at that. I'd recommend sticking clothes on the model itself. The other alternative is simply rendering clothing at the same location.

Hope tha thelps ;)

chris

unread,
Mar 4, 2011, 11:44:23 PM3/4/11
to PYGGEL-dev
ya, i have been thinking that maybe i just need something more suited
to my needs, realized that this was made more for small games, not a
full-blown rpg like i'm trying to make. I am going to try Panda3D.
Thank you everyone for your help, im glad i didnt get too far, only 31
lines
Reply all
Reply to author
Forward
0 new messages