What's this? Graphics in the ps2sdk?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

What's this? Graphics in the ps2sdk?

Post by ooPo »

Some of you may have taken a look at the stuff I've been adding to ps2sdk lately. Some of you may have been too unsure of what it all does and have avoided it. So, here's a link to a quick document on how to use it:

http://www.oopo.net/consoledev/files/ps ... ibdraw.txt
// So, you want to do your own 3D programs on the PS2. As you may already know,
// there isn't a lot of help out there to learn from. You may stumble through
// countless old documents from the demo scene days where most of the info was
// on how to write your own rasterizer instead of the math. Or you may run into
// countless opengl and directx articles that really don't teach you much other
// than 'use this function'.
//
// I've written this very simple, and compileable, document that may be able to
// shed some light on the subject. I've also created a few libraries in ps2sdk
// to make this a process that you can take on at your own pace. As you figure
// out how this program works, you can take a look at the libdraw source. From
// there, you can take a look at libgraph and libmath3d. If you're feeling spicy,
// libdma and libpacket await you. Its not that complicated when compared to the
// pc you're used to... its just different.
This new 'draw' library is designed to be an easy stepping stone into a subject that can be a little complex to tackle all at once.

If you remain unconvinced, or just plain lazy, here's a link to precompiled versions of the samples:

http://www.oopo.net/consoledev/files/sa ... 050615.tgz

(the lighting sample with the teapot is my favorite)

They should handle NTSC/PAL autodetection and possibly even 4:3/16:9 autodetection assuming that the OSD functions are broken only on the pstwo I'm using to code on lately.

Be advised the API may wiggle a little before it settles.
wulf
Posts: 81
Joined: Wed Apr 13, 2005 6:56 pm

Post by wulf »

You are the man, oopo!
Steve F
Posts: 75
Joined: Wed Apr 27, 2005 2:30 am
Location: Texas USA

Post by Steve F »

Nice work!

I was a little confused by the term 'points'. I think of a point as the same as a vertex. In this case it is an index into the vertices array that describes the three vertices that make up a triangle.

A triangle is defined by vertices. A Vertex is defined by vectors on n axis. Usage of the term Points is misleading?

And a polygon's shape is defined by vertices. Is a point a polygon with zero sides (technically)?

In that case I should redefine; a triangle is defined by 3 points. A Point is defined by a vertex. A vertex is defined by vectors on n axis.

I'm going to have to rethink how I've been naming things.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Don't take my naming of things as perfect. I'm still kinda learning this myself.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Unrelated tangent posts about ODE split Here

On topic:
Great work oopo. :)
Shoot Pixels Not People!
Makeshift Development
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Just for fun, here's some screendumps of the graphics samples in ps2sdk currently:

Image
$PS2SDK/samples/cube
Your basic spinning cube teaches basic 3D math skills and concepts.

Image
$PS2SDK/samples/teapot
The classic teapot model shows you how to perform lighting and shading.

Image
$PS2SDK/samples/texture
A spinning cube with a perspective-correct texture applied teaches texturing.
snowdog
Posts: 5
Joined: Wed Jun 15, 2005 1:43 am

Post by snowdog »

Cool, cheers for this. But just one question...any idea how close using this would be to using the equivalent functions in the Official Sony PS2 SDK..?

If I understand this and can write a demo or two (although this is also assuming I can get through the Unix learning curve after a 10-15 years absence lol) with the unofficiak PS2Dev SDK then would I have much trouble using the Official SDK..?

I'm currently working in the games industry as a QA Technician to get myself a foothold in the industry and would like to end up developing games. Unfortunately the developers across the hall from me are only PC programmers, so can't ask them for any advice.

I've started to mess around with the DirectX SDK with the help of a bloomin great big book and am looking forward to doing the same with the samples you've provided here. Many thanks, any advice anyone can give me would be much appreciated.
"You can keep all your Bests, Peles and Maradonas, Duncan Edwards was the greatest of them all!" - Tommy Docherty
Post Reply