GU_TRANSFORM_3D + GU_VERTEX_16BIT = nothing drawn?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

GU_TRANSFORM_3D + GU_VERTEX_16BIT = nothing drawn?

Post by Brunni »

I have a very strange problem, while in 2D it works fine, in 3D if I use 16 bits vertices nothing will be drawn :(
Has anyone had this issue? Thanks.
Sorry for my bad english
Image Oldschool library for PSP - PC version released
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

When you use 3D transforms and 16-bit (or 8-bit) vertices, they are normalized to [-1..1] which means that you'd have to transform them to their original size and pivot using the model-transform.
GE Dominator
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Err... okay thanks :) But I'm a completely beginner in 3D, could you explain me how can I do that please?
Sorry for my bad english
Image Oldschool library for PSP - PC version released
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

You first find the scale value for each axis (measure the distance between the lowest and highest coordinate), and then figure out a good center so that you can use as much of the resolution between -1 and 1 (-32768 - 32767). You then store these values so that you can construct a matrix that translates & scales your model into the proper location & size. Translate & divide the model down so that it fits within this area.

When rendering you push the matrix on the model-stack the first thing you do and the rest should work.

If you can't follow this, I recommend you research matrices or stick to 32-bit coordinates. :)
GE Dominator
McZonk
Posts: 35
Joined: Thu Jul 14, 2005 10:42 pm
Location: Germany
Contact:

Post by McZonk »

I have written a sample that show the behavior of integer drawing in 3d mode.
http://svn.ps2dev.org/filedetails.php?r ... rev=0&sc=0
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Well, well... are you adding 3D to OldSchool, Brunni? That would be a nice addition. :)
Post Reply