forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GU_TRANSFORM_3D + GU_VERTEX_16BIT = nothing drawn?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Feb 26, 2006 5:38 am    Post subject: GU_TRANSFORM_3D + GU_VERTEX_16BIT = nothing drawn? Reply with quote

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
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Sun Feb 26, 2006 10:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Mon Feb 27, 2006 3:04 am    Post subject: Reply with quote

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
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Mon Feb 27, 2006 10:04 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
McZonk



Joined: 14 Jul 2005
Posts: 35
Location: Germany

PostPosted: Sun Oct 07, 2007 11:14 pm    Post subject: Reply with quote

I have written a sample that show the behavior of integer drawing in 3d mode.
http://svn.ps2dev.org/filedetails.php?repname=psp&path=%2Ftrunk%2Fpspsdk%2Fsrc%2Fsamples%2Fgu%2Fintegerdrawing%2Fintegerdrawing.c&rev=0&sc=0
_________________
http://emergencyexit.untergrund.net - Quake 2 PSP
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Oct 08, 2007 2:03 am    Post subject: Reply with quote

Well, well... are you adding 3D to OldSchool, Brunni? That would be a nice addition. :)
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group