繪圖演算法
⑴ 什麼是力導向布局圖
力導向圖(Force-Directed Graph),是繪圖的一種演算法。在二維或三維空間里配置節點,節點之間用線連接,稱為連線。各連線的長度幾乎相等,且盡可能不相交。節點和連線都被施加了力的作用,力是根據節點和連線的相對位置計算的。根據力的作用,來計算節點和連線的運動軌跡,並不斷降低它們的能量,最終達到一種能量很低的安定狀態。
力導向圖能表示節點之間的多對多的關系
⑵ 目前在繪畫領域的三種代表性演算法
您好,茫茫人海之中,能為君排憂解難實屬朕的榮幸,在下拙見,若有錯誤,還望見諒!。展開全部
現代
特徵一:繪畫的表現形式從具象轉變為抽象或意象
特徵二:由再現客觀世界轉變為表現主觀世界
古代
和諧性
象徵性
靈動性
天趣性
特徵一:繪畫的表現形式從具象轉變為抽象或意象
現代主義繪畫與傳統繪畫相比有相當大的區別,以畢加索的《格爾尼卡》和德拉克洛瓦的《希奧島的屠殺》為例。前者是現代主義繪畫立體主義的代表作,後者是傳統繪畫浪漫主義的精典作品,兩幅繪畫同樣都是表現戰爭題材,但是從作品的表現形式來看,卻是大相徑庭。《希奧島的屠殺》運用了明暗造型的方法,真實地刻畫了耀武揚威的侵略者和倒在血泊中絕望掙扎的孤立無助的受壓迫者的殘狀,是具象的畫面
特徵二:由再現客觀世界轉變為表現主觀世界
格爾尼卡》正是以象徵性的手法、變形的形體和灰暗的色調,表現了戰爭的罪惡和災難的悲劇。畫面中牛頭是法西斯殘暴的象徵,肢離破碎的人體是人民殘遭迫害的殘狀,畫面上方的燈泡一樣的眼睛則是對法西斯暴行的揭露。那變形的形體相互交錯、拼貼組成了一種混亂的視覺效果和殘暴恐怖的氣氛,而這正是戰爭在畢加索腦海中的一種主觀反映,畢加索正是通過這些極度誇張、變形的圖式,表達了他對德國法西斯暴行的強烈仇恨。由此可見,現代主義繪畫的特徵之二,就是從傳統繪畫的再現客觀世界轉變為表現主觀世界。而這一點正與中國寫意畫的特點不謀而合,畫家不再以畫得與客觀世界逼真肖似為目的,而是以被描繪的對象為媒介,表現自己的情感、觀念、思想等主觀世界,將客觀對象按照主觀意圖進行變形或抽象化處理。非常感謝您的耐心觀看,如有幫助請採納,祝生活愉快!謝謝!
⑶ java繪圖演算法
最節能就是把6個圖片輪流畫一次,不過你要把這六個圖片弄成資源,然後就當作普通圖來畫,這是最簡單的方法,如果你要全部自己弄,這6個圖很難創建出來,你圖里有漸變效果,這個漸變的值不知道是多少。我給一個畫漸變園的類給你。如果要自己畫可能有點用。
public class PaintTest {
public static void main(String[] args) {
JFrame frame = new PaintTestFrame();
frame.show();
}
}
class PaintTestFrame extends JFrame implements ActionListener {
public PaintTestFrame() {
setTitle("PaintTest");
setSize(400, 400);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
Container contentPane = getContentPane();
canvas = new PaintPanel();
contentPane.add(canvas, "Center");
JPanel buttonPanel = new JPanel();
ButtonGroup group = new ButtonGroup();
colorButton = new JRadioButton("Color", true);
buttonPanel.add(colorButton);
group.add(colorButton);
colorButton.addActionListener(this);
gradientPaintButton = new JRadioButton("Gradient Paint", false);
buttonPanel.add(gradientPaintButton);
group.add(gradientPaintButton);
gradientPaintButton.addActionListener(this);
texturePaintButton = new JRadioButton("Texture Paint", false);
buttonPanel.add(texturePaintButton);
group.add(texturePaintButton);
texturePaintButton.addActionListener(this);
contentPane.add(buttonPanel, "North");
}
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if (source == colorButton) {
canvas.setColor();
} else if (source == gradientPaintButton) {
canvas.setGradientPaint();
} else if (source == texturePaintButton) {
canvas.setTexturePaint();
}
}
private PaintPanel canvas;
private JRadioButton colorButton;
private JRadioButton gradientPaintButton;
private JRadioButton texturePaintButton;
}
class PaintPanel extends JPanel {
public PaintPanel() {
Image image = Toolkit.getDefaultToolkit().getImage("java2s.gif");
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(image, 0);
try {
tracker.waitForID(0);
} catch (InterruptedException e) {
}
bufferedImage = new BufferedImage(50, 50, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = bufferedImage.createGraphics();
g2.drawImage(image, 0, 0, null);
setColor();
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setPaint(paint);
Ellipse2D circle = new Ellipse2D.Double(0, 0, getWidth(), getHeight());
g2.fill(circle);
}
public void setColor() {
paint = Color.red; // Color implements Paint
repaint();
}
public void setGradientPaint() {
paint = new GradientPaint(0, 0, Color.red, (float) getWidth(),
(float) getHeight(), Color.blue);
repaint();
}
public void setTexturePaint() {
Rectangle2D anchor = new Rectangle2D.Double(0, 0, 2 * bufferedImage.getWidth(), 2 * bufferedImage.getHeight());
paint = new TexturePaint(bufferedImage, anchor);
repaint();
}
private Paint paint;
private BufferedImage bufferedImage;
}