Simple 3D graphics sample

Programming examples for the Psy-Q SDK
Post Reply
User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Simple 3D graphics sample

Post by LameGuy64 » March 3rd, 2014, 12:20 am

I finally managed to figure out how the 3D graphics system of the PlayStation works and was able to make a nice little sample for you guys to learn from as there hasn't been a good 3D graphics example for a long while.

Image

Unfortunately, this sample only uses flat shaded triangles but I might make another similar sample soon but with texture mapped triangles in a form of a little 3D game engine.
You do not have the required permissions to view the files attached to this post.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » March 4th, 2014, 5:12 pm

Agreed. We definitely need more 3d stuff.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

TheDukeOfZill
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Apr 07, 2014

Post by TheDukeOfZill » April 7th, 2014, 10:31 am

I'm looking to start making 3D homebrew PSX games and this really helped. I made a script to export a model from Blender into this same format you're using, with the exception that it doesn't store duplicate vertices and instead contains an array of indices to the shared vertices. I realize the vertex data is stored as shorts, so this actually uses more memory, but it's more organized this way IMHO. http://pastebin.com/suU9DigB

The only modification I really had to make to get it to work this way (aside from changing the mesh name) was to change

Code: Select all

RotTransPers(&modelCube_mesh[t]...
to

Code: Select all

RotTransPers(&modelCube_mesh[modelCube_index[t]]...
Definitely looking forward to any more progress you make!

User avatar
bizarro2011
Serious PSXDEV User
Serious PSXDEV User
Posts: 118
Joined: Mar 27, 2012
Location: Brazil

Post by bizarro2011 » April 12th, 2014, 11:47 am

very good, will create a table to write text and numbers. :clap

Tommy
Active PSXDEV User
Active PSXDEV User
Posts: 48
Joined: Apr 19, 2014

Post by Tommy » April 24th, 2014, 1:56 pm

Good stuff.

Re: the dangling comment about RotMeshPrimS_F3; my reading of the documentation is that the MeshPrimS functions expect a triangle strip — the first three vertices define one triangle, then every subsequent vertex defines one further triangle. You've listed each triangle uniquely — the first three vertices define one triangle, then every subsequent three vertices define one further triangle. So that could be why that didn't work.

ZackVL
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: Sep 06, 2015
I am a: New Programmer
PlayStation Model: SCPH-9002
Location: Greece

Post by ZackVL » September 10th, 2015, 11:08 pm

can you post the make file?

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » September 10th, 2015, 11:38 pm

The MAKEFILE would be basically the same as the one in your 'helowrld' example because of its simplistic primary C file, "primdraw.c".

Code: Select all

# -----------------------------------------
#       PlayStation 1 Psy-Q Makefile
# -----------------------------------------

all:
	del mem.map
	del main.sym
	del main.exe
	del main.cpe
	cls

	ccpsx -Xo$80010000 primdraw.c -oprimdraw.cpe,primdraw.sym,mem.map
	cpe2x primdraw.cpe
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

ZackVL
Interested PSXDEV User
Interested PSXDEV User
Posts: 8
Joined: Sep 06, 2015
I am a: New Programmer
PlayStation Model: SCPH-9002
Location: Greece

Post by ZackVL » September 11th, 2015, 12:22 am

thank's shadow!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests