| View previous topic :: View next topic |
| Author |
Message |
Brunni
Joined: 08 Oct 2005 Posts: 186
|
Posted: Sun Feb 26, 2006 5:38 am Post subject: GU_TRANSFORM_3D + GU_VERTEX_16BIT = nothing drawn? |
|
|
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 |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Sun Feb 26, 2006 10:15 am Post subject: |
|
|
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 |
|
 |
Brunni
Joined: 08 Oct 2005 Posts: 186
|
Posted: Mon Feb 27, 2006 3:04 am Post subject: |
|
|
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 |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Mon Feb 27, 2006 10:04 pm Post subject: |
|
|
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 |
|
 |
McZonk
Joined: 14 Jul 2005 Posts: 35 Location: Germany
|
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Oct 08, 2007 2:03 am Post subject: |
|
|
| Well, well... are you adding 3D to OldSchool, Brunni? That would be a nice addition. :) |
|
| Back to top |
|
 |
|