Page 1 of 1

Simple 3D graphics sample

Posted: March 3rd, 2014, 12:20 am
by LameGuy64
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.

Re: Simple 3D graphics sample

Posted: March 4th, 2014, 5:12 pm
by Shendo
Agreed. We definitely need more 3d stuff.

Re: Simple 3D graphics sample

Posted: April 7th, 2014, 10:31 am
by TheDukeOfZill
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!

Re: Simple 3D graphics sample

Posted: April 12th, 2014, 11:47 am
by bizarro2011
very good, will create a table to write text and numbers. :clap

Re: Simple 3D graphics sample

Posted: April 24th, 2014, 1:56 pm
by Tommy
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.

Re: Simple 3D graphics sample

Posted: September 10th, 2015, 11:08 pm
by ZackVL
can you post the make file?

Re: Simple 3D graphics sample

Posted: September 10th, 2015, 11:38 pm
by Shadow
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

Re: Simple 3D graphics sample

Posted: September 11th, 2015, 12:22 am
by ZackVL
thank's shadow!