Jump to content

  • Log In with Google      Sign In   
  • Create Account

view Matrix as static class , is it possible?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Wangru   Members   -  Reputation: 208

Like
0Likes
Like

Posted 28 April 2012 - 10:47 AM

Is it possible?
we have a class name ViewMatrix suppose and it have got a Matrix as member and some other functions. I want to make it static , I will update this matrix member using it's function update and will get it's value using get function or simply viewMatrix.matrix ...
I don't have to keep a seperate copy of view matrix for each point I am rendering on screen ( Actually I will be rendering thousands of points at same time ) .. no object will be created for this class this way too ...

Sponsor:

#2 Tom KQT   Members   -  Reputation: 1621

Like
0Likes
Like

Posted 28 April 2012 - 11:49 AM

I think that view matrix makes more sense as a member of a Camera class, together with projection matrix. This class then can have methods to build these two matrices, depending on type of the camera.
You can have a hierarchy of camera types, for example an abstract class Camera having view and proj matrices as members and pure virtual methods BuildProj() and BuildView(). Then two abstract subclasses OrthoCamera and PerspectiveCamera, each of them with its own implementation of BuildProj().
And finaly subclasses like for example OrbitCamera, FPSCamera etc etc, each with its own implemenation of BuildView().

But of course it depends all on you, it's your code. That's just my suggestion. Btw I hope the suggestion makes sense, I pulled it out of my head :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS