Monday, December 22, 2008

Texture Mapping is Coming

So, I've been playing around with Blender. I'm having to learn as much about 3D programs as I am about OpenGL for this project. While I have used 3D programs in the past, it's been almost a decade, and I was never very serious, mostly just playing because I had access to some workstations with Lightwave installed on them so I was able to play for free. All I can say is thank dog for Blender. It's one hell of a program for the price (it's free). I'm sure Maya and 3DMax and Lightwave and several other programs are "better" in ways, but this is a darn nice program. It far surpasses what even the commercial 3D programs were capable of when I last worked with them. It certainly is capable enough for my needs, and probably could serve quite well as the main modeling tool for an iPhone game.

The point of all this is just to let you know you that I've now created some texture mapped Wavefront OBJ files. I'm starting with two simple cubes, one using simple texture mapping, and another one that uses UV mapping:


Once I get these working, I'll create some more complex texture-mapped models to test with.

You can tell from the image above that I'm no graphic artist, so if you've created a good, moderately complex, UV-textured 3D object you'd like to contribute to the cause, I'd love to hear from you.

I'll probably have the time to actually code the texture mapping stuff toward the end of the week. I'm still under the gun for client work, but should get some time for fun stuff over the holiday.



6 comments:

Mike said...

If you are looking at creating a Blender exporter you can definitely learn A LOT and save a bunch of time by going through the Blender exporter for SIO2 3D engine (http://www.sio2interactive.com/HOME/HOME.html). If you download the project zip just take a look at the 'exporter' directory for a Python script that exports all vertices, faces, materials and even physics properties for Bullet, sounds and more. It's some really solid code and Blender is an awesome tool (and free!).

Jeff LaMarche said...

Thanks, Mike. Although I must admit a certain aversion to Python, I will definitely check it out. I seem to recall having downloaded their engine at one point, but don't think I ever found time to look it over.

Eric said...

I've tried out SIO2, and the exporter was nice but I found it to be hard to use in some ways. We spend all this time learning OpenGL and then it's like relearning everything.

Jeff LaMarche said...

Eric:

Whooo-boy, do you speak the truth (about 3D in general, not (necessarily) about SIO2, on which I have no firm opinion). As I started learning OpenGL ES, it had been almost a decade since I had programmed any kind of 3D graphics. I did some OpenGL years back, before that some Quicktime 3D, and before that, some hand-coded 3D work.

In school, geometry was my weakest math by far. I never really grokked the maths behind matrix transformations until I started working with 3D graphics and had a concrete use for it. But, cartesian geometry is still a challenge for me conceptually. Algebra, Trig, and Calculus were all almost second nature to me. It's funny that now, 20 years later, geometry is the one - easy to learn and understand. Geometry... not so much. I really want to understand it well, but the brain doesn't seem to want to.

Ah, well... gotta keep feeding the elephant's child...

Mike said...

For SIO2, a lot of the more difficult things in 3D like culling and multiple textures are all done for you. Not to mention, if you go through the video tutorials you can actually have something pretty nice with physics in mere minutes. It is definitely worth the effort to use a nice framework.

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels