About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Active Camera
Author Message
djpercy Offline
Member

Post: #1
Active Camera
Hi,

in the Camera.h you say the active Camera is Cam
Cam; // Active Camera
I create two Camera's and I activated with this code
Code:
Camera *camera1=NULL;
Camera *camera2=NULL;
void InitPre()
{
...
   camera1 = new Camera();
   camera2 = new Camera();
   camera1->at.set(10,0,10);
   camera2->at.set(16,0,16);
...
}

Bool Update() // main updating
{
   // here you have to process each frame update
   if (Kb.bp(KB_X)) {
      D.text (0, 0.1,"This is the First Tutorial");}
  
   if(Kb.bp(KB_ESC))return false; // exit if escape on the keyboard pressed

   &camera2->set();
   Game::World.update(Cam.at);
  
  
   return true;                   // continue
}

The camera show something but not the right view from camera2.

Greeting Denis
(This post was last modified: 11-22-2010 11:18 PM by djpercy.)
11-22-2010 11:01 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Active Camera
you can call cam.setSpherical (cam.matrix is the key, cam.at itself wont change the matrix, only after setspherical)
11-22-2010 11:53 PM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #3
RE: Active Camera
Hi,

sorry, i don't understand this.
Help me a Littel bit more, please.
I put it in my code but I see the same result before

Code:
void Render()
{
    
    switch(Renderer())
   {
      case RM_PREPARE:
      {  
         Game::World.draw();
        
        
         LightPoint(25,Vec(0,3,0)).add();
      }break;
   }
  
}

void Draw() // main drawing
{
  
   Renderer(Render);
   D.viewRect(NULL);
   Rect rect(1,0.5,2,2);
   D.viewRect(rect);
   Cam.setSpherical(camera2->at,0,-0.5,0,10);
   Renderer(Render);  
  

}

Greetimg Denis
11-23-2010 06:20 PM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #4
RE: Active Camera
Hi,

I have put this code and it work know smile

Code:
Cam.setSpherical(camera1->at,0,0,0,0).set();
11-23-2010 08:18 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #5
RE: Active Camera
If you just read the post from Esenthel more carefully in the other thread you didn't need to ask here at all tho...

There is always evil somewhere, you just have to look for it properly.
11-23-2010 08:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #6
RE: Active Camera
Hi Dynad,

this is not the same Question. I think you must read the post more carefully.
The Problem is the answers a very small. show my last post.

My Question:
"How can I create a second camera?
How can I render the view from the second camera on a 3D Object?"

your Answers:
Well you need to create a second Camera and use those coordinates for the second view.

what is it?

Why do not say you must do this here a the code snip.
cam.setSpherical (cam.matrix is the key, cam.at itself wont change the matrix, only after setspherical)

That is a correctly Answers all the others is a riddle and not more.

Greeting Denis
(This post was last modified: 11-23-2010 10:17 PM by djpercy.)
11-23-2010 10:17 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #7
RE: Active Camera
You can better cool down here m8... we are here to help people out.. and the tutorials are pretty self explaining.

There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 11-24-2010 09:02 AM by Dynad.)
11-24-2010 08:53 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #8
RE: Active Camera
Actually Dynad's answer was correct he was most likely assuming you already used setSpherical, you should've seen that you didnt use the setSpherical(you did say you knew the tutorials, and it shows how to create a camera), if you wanted code snippet you should directly asked "could you show me a example snippet" or the likes. Even though its not the exact same question its very much related to the earlier topic of yours.

Now I dont see why you would pester yourselves with being rude. >_<
(This post was last modified: 11-24-2010 11:41 AM by Zervox.)
11-24-2010 11:39 AM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #9
RE: Active Camera
hi,

sometimes is not to easy, I mean's not so. Sorry.
Next time I'll ask myself better, and directly on the code snippets.
I hope you're not too angry at me.

Thanks for your understanding

Greeting Denis
11-24-2010 09:53 PM
Find all posts by this user Quote this message in a reply
Post Reply