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 

[triEngine] How to correctly use tri3dOrtho() ?

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



Joined: 29 Nov 2008
Posts: 7

PostPosted: Sat Nov 29, 2008 11:05 pm    Post subject: [triEngine] How to correctly use tri3dOrtho() ? Reply with quote

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
View user's profile Send private message
Yan2Yan



Joined: 29 Nov 2008
Posts: 7

PostPosted: Sun Nov 30, 2008 11:46 pm    Post subject: Reply with quote

It would be very nice if somebody could help me ...
Back to top
View user's profile Send private message
PosX100



Joined: 15 Aug 2007
Posts: 98

PostPosted: Mon Dec 01, 2008 3:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Yan2Yan



Joined: 29 Nov 2008
Posts: 7

PostPosted: Mon Dec 01, 2008 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
PosX100



Joined: 15 Aug 2007
Posts: 98

PostPosted: Mon Dec 01, 2008 9:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Yan2Yan



Joined: 29 Nov 2008
Posts: 7

PostPosted: Tue Dec 02, 2008 5:57 am    Post subject: Reply with quote

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