| View previous topic :: View next topic |
| Author |
Message |
Yan2Yan
Joined: 29 Nov 2008 Posts: 7
|
Posted: Sat Nov 29, 2008 11:05 pm Post subject: [triEngine] How to correctly use tri3dOrtho() ? |
|
|
Hi, my question is "How to correctly use tri3dOrtho() ?"
I've tried some things, but when I call this function nothing is displayed on screen.
For example, I tried with the sample called "particle"; something like this :
| Code: |
while(1)
{
triBegin();
triClear( 0x220000 );
tri3dClear( 1, 0, 1 );
triOrtho();
triCameraUpdateMatrix( cam );
sceGumMatrixMode (GU_MODEL);
sceGumLoadIdentity ();
triTimerUpdate(frametimer);
triParticleManagerUpdateRender( cam, triTimerGetDeltaTime(frametimer) );
triEnd();
triSwapbuffers();
}
|
But nothing's displayed.
It would be very nice if somebody could help me.
Thanks ... |
|
| Back to top |
|
 |
Yan2Yan
Joined: 29 Nov 2008 Posts: 7
|
Posted: Sun Nov 30, 2008 11:46 pm Post subject: |
|
|
| It would be very nice if somebody could help me ... |
|
| Back to top |
|
 |
PosX100
Joined: 15 Aug 2007 Posts: 98
|
Posted: Mon Dec 01, 2008 3:31 am Post subject: |
|
|
Well , there should be a method for pushing
your translation matrix on the top of the stack , or NO?
Using matrix stack to hierarchically update each object :
| Code: |
push matrix
camera->update()
push matrix //obj 1
a->model->rotate()
a->model->scale()
a->model->translate()
a->model->render()
pop matrix
push matrix //obj 2
b->model->rotate()
b->model->scale()
b->model->translate()
b->model->render()
pop matrix
push matrix //particles
TVector3* particle_pos = $middle of view vector$
renderParticlesAt(particle_pos,app->gelta)
pop matrix
pop matrix //camera
swap buffers
|
|
|
| Back to top |
|
 |
Yan2Yan
Joined: 29 Nov 2008 Posts: 7
|
Posted: Mon Dec 01, 2008 7:24 am Post subject: |
|
|
I think I don't understand what you want me to do. Sorry.
I wonder if I can call triOrtho() when I use a camera.
I've seen the sample in the sdk ('ortho') and no camera are used. So I will try to use my code without camera tomorow ... (but a camera is needed for the particle system :s ) |
|
| Back to top |
|
 |
PosX100
Joined: 15 Aug 2007 Posts: 98
|
Posted: Mon Dec 01, 2008 9:02 pm Post subject: |
|
|
| Yan2Yan wrote: | I think I don't understand what you want me to do. Sorry.
|
If you have no idea what a translation/transformation matrix is , then you should study more , or use another library ...
| Quote: | | (but a camera is needed for the particle system :s ) |
"camera" should probably be a 3d vector , or it must have a 3d vector
structure somewhere. |
|
| Back to top |
|
 |
Yan2Yan
Joined: 29 Nov 2008 Posts: 7
|
Posted: Tue Dec 02, 2008 5:57 am Post subject: |
|
|
| PosX100 wrote: | If you have no idea what a translation/transformation matrix is , then you should study more , or use another library ...
|
I know what a translation/transformation matrix is, but you're right, I have to study more. I begin learning 3D and I think it's normal that I don't understand everything.
The triEngine offers a function that normally simplifies the usage of the ortho mode and I can't make it running, that's why I need help. ^^
PS : sorry for my bad english, I'm french :P |
|
| Back to top |
|
 |
|