/** XXX * @param pPointToCalc to calculates texture coordinates * @param pPlaneNormal normal vector of surface plane * @param pLineVector vector laying on the plane (texture is parallel to this vector) * @param pStartPoint point when texture starts, laying on surface * @param pTexture texture * @return uv cordinates for texture */ private TextCoord calcUV(Point3d pPointToCalc, Vector3d pPlaneNormal, Vector3d pLineVector, Point3d pStartPoint, TextureData pTexture) { return TextCordFactory.calcFlatSurfaceUV(pPointToCalc, pPlaneNormal, pLineVector, pStartPoint, pTexture); }
/** XXX * @param pPointToCalc to calculates texture coordinates * @param pPlaneNormal normal vector of surface plane * @param pLineVector vector laying on the plane (texture is parallel to this vector) * @param pStartPoint point when texture starts, laying on surface * @param pTexture texture * @return uv cordinates for texture */ private TextCoord calcUV(Point3d pPointToCalc, Vector3d pPlaneNormal, Vector3d pLineVector, Point3d pStartPoint, TextureData pTexture) { return TextCordFactory.calcFlatSurfaceUV(pPointToCalc, pPlaneNormal, pLineVector, pStartPoint, pTexture); }
/** * Texture projection on surface. * * @param pPointToCalc to calculates texture coordinates * @param pPlaneNormal normal vector of surface plane * @param pLineVector vector laying on the plane (texture is parallel to this vector) * @param pStartPoint point when texture starts, laying on surface * @param pTexture texture * @return uv cordinates for texture */ public static TextCoord calcFlatSurfaceUV(Point3d pPointToCalc, Vector3d pPlaneNormal, Vector3d pLineVector, Point3d pStartPoint, TextureData pTexture) { return calcFlatSurfaceUV(pPointToCalc, pPlaneNormal, pLineVector, pStartPoint, pTexture, 0, 0); } /**
TextCoord calcUV = TextCordFactory.calcFlatSurfaceUV(point3d, plane2.getNormal(), pRoofLineVector, plane2.getPoint(), roofTexture, textureOffsetU, textureOffsetV);
/** * @param pMeshRoof * @param pPlane * @param pTextureVector * @param pTextureData * @param textureOffsetU * @param textureOffsetV * @param normalIndex * @param face * @param point2d */ private static void addPointToTriangleFace(MeshFactory pMeshRoof, Plane3d pPlane, Vector3d pTextureVector, TextureData pTextureData, double textureOffsetU, double textureOffsetV, int normalIndex, FaceFactory face, Point2d point2d) { double h = pPlane.calcYOfPlane(point2d.x, -point2d.y); Point3d point3d = new Point3d(point2d.x, h, -point2d.y); int vi = pMeshRoof.addVertex(point3d); // Point3d point3d = pMeshRoof.vertices.get(vi); face.addVertIndex(vi); face.addNormalIndex(normalIndex); TextCoord calcUV = TextCordFactory.calcFlatSurfaceUV(point3d, pPlane.getNormal(), pTextureVector, pPlane.getPoint(), pTextureData, textureOffsetU, textureOffsetV); int tci = pMeshRoof.addTextCoord(calcUV); face.addCoordIndex(tci); }