Author Topic: manually draw a face  (Read 2006 times)

Offline pitt

  • byte
  • *
  • Posts: 13
    • View Profile
manually draw a face
« on: May 25, 2006, 05:12:15 pm »
Hi egon,

    Correct this code for me please.
    manually draw the face by a given Object3D and the polyid.
    PolygonManager poly=obj.getPolygonManager();
    SimpleVector p=poly.getTransformedVertex(polyid,2);

    This code goes wrong when I rotate the Y axis of the Camera.
Other axes work properly, I guess.  I need to manually draw some faces cause they are not listed in VisList. But, they can be seen.

Thank you.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11884
    • View Profile
manually draw a face
« Reply #1 on: May 25, 2006, 06:33:42 pm »
After getTransformedVertex(), you are in world space, not in camera (eye) space. You have to apply the camera's transformation to the vertices (i.e. translate by the negative camera position, apply the cam's rotation matrix).