About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
3D Object in front of View
Author Message
djpercy Offline
Member

Post: #1
3D Object in front of View
Hi,

How can i do that a 3D Object in front of View is.
I would like my 3D Object a permanently fixed poistion on the right Side of the display.

Greeting Denis
11-15-2010 11:58 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: 3D Object in front of View
draw the object with matrix relative to camera
11-15-2010 01:32 PM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #3
RE: 3D Object in front of View
Hi,

what is wrong my 3D object not rotate. This is my code

Code:
STRUCT(DMap , Game::Kinematic)
   virtual Bool update();
};

Bool DMap::update()
{
   return __super::update();based on
}


DMap  map;
Bool Init()
{
   Game::ObjParams obj;
   obj.mesh    (true, Meshes   .ptr("obj/map/0.mesh"));
   obj.matrix;
   mi.create(obj);
   return true;
}

void Draw()  
{  
   Matrix m =map.matrix() ;
   m.setRotateZ(Time.time());
   m.move(Vec(3,0,0));
   SetMatrix(m);
   map.drawPrepare();
}

Greetin Denis
(This post was last modified: 11-17-2010 11:25 PM by djpercy.)
11-17-2010 11:20 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: 3D Object in front of View
hi, please check rendering tutorials, you shouldnt call drawPrepare in Draw
but use Renderer, and call drawPrepare inside Render when Renderer()==RM_PREPARE
11-17-2010 11:43 PM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #5
RE: 3D Object in front of View
Hi,

i have do this i put it in the Render. Don't work

Code:
void Render()
{   switch(Renderer())
   {
      case RM_PREPARE:
      {  
        
         map.drawPrepare();
        
         LightDir(!(Cam.matrix.x-Cam.matrix.y+Cam.matrix.z)).add();
      }break;
   }

}

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

Post: #6
RE: 3D Object in front of View
You're basing your sources on Game::Kinematic so check what does the "drawPrepare" method, and what matrix it uses.
I guess you should adjust map.matrix(new_matrix)
11-17-2010 11:59 PM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #7
RE: 3D Object in front of View
Hi,

Thanks, it work smile
Code:
void Render()
{   switch(Renderer())
   {
      case RM_PREPARE:
      {  
         Matrix m ;
         m.setRotateZ(Time.time());
         m.move(Vec(3,0,0));  
         SetMatrix(m);
         map.matrix(m);
         map.drawPrepare();
        
         LightDir(!(Cam.matrix.x-Cam.matrix.y+Cam.matrix.z)).add();
      }break;
   }
}
Hi,

how can i Rotate the Object to centerpoint

Gretting Denis
Hi,

it Work now. I have set the 3D Object to center in the Mesh Editor smile

Gretting Denis
(This post was last modified: 11-18-2010 12:24 AM by djpercy.)
11-18-2010 12:07 AM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #8
RE: 3D Object in front of View
Hello,

I Need help. I have try the 3D object bring in Front of view, i'm failed can you help me please.

Greetings Denis
(This post was last modified: 12-05-2011 03:03 PM by djpercy.)
12-04-2011 10:37 PM
Find all posts by this user Quote this message in a reply
Post Reply