[triEngine] How to correctly use tri3dOrtho() ?

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

Moderators: cheriff, TyRaNiD

Post Reply
Yan2Yan
Posts: 7
Joined: Sat Nov 29, 2008 8:26 pm

[triEngine] How to correctly use tri3dOrtho() ?

Post by Yan2Yan »

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: Select all

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 ...
Yan2Yan
Posts: 7
Joined: Sat Nov 29, 2008 8:26 pm

Post by Yan2Yan »

It would be very nice if somebody could help me ...
PosX100
Posts: 98
Joined: Wed Aug 15, 2007 1:02 am

Post by PosX100 »

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: Select all

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
Yan2Yan
Posts: 7
Joined: Sat Nov 29, 2008 8:26 pm

Post by Yan2Yan »

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 )
PosX100
Posts: 98
Joined: Wed Aug 15, 2007 1:02 am

Post by PosX100 »

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 ...

(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.
Yan2Yan
Posts: 7
Joined: Sat Nov 29, 2008 8:26 pm

Post by Yan2Yan »

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
Post Reply