{"id":623,"date":"2004-06-01T21:24:08","date_gmt":"2004-06-01T12:24:08","guid":{"rendered":"\/?p=623"},"modified":"2004-06-01T21:24:08","modified_gmt":"2004-06-01T12:24:08","slug":"java-computer-graphics","status":"publish","type":"post","link":"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/623.html","title":{"rendered":"Java Computer Graphics"},"content":{"rendered":"<p>Java\u306b\u3088\u308b\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u306e\u57fa\u790e\u306b\u3064\u3044\u3066\u3001\u601d\u3044\u3064\u304f\u307e\u307e\u306b\u66f8\u3044\u3066\u307f\u3088\u3046\u3068\u601d\u3046\u3002<br \/>\n\u307e\u305a\u306f\u9802\u70b9\u3092\u8868\u73fe\u3059\u308b\u3068\u3053\u308d\u304b\u3089\u3060\u3002<br \/>\n<!--more--><br \/>\n\u3068\u308a\u3042\u3048\u305a\u3001\uff13\u6b21\u5143\u306b\u304a\u3051\u308b\u9802\u70b9\u3092\u30af\u30e9\u30b9\u3067\u8868\u3059\u3068\u3001\u3053\u3093\u306a\u611f\u3058\u3060\u308d\u3046\u3002\u70b9\u306e\u60c5\u5831\u3092\u4fdd\u6301\u3059\u308b\u3088\u3046\u306b\u3057\u3001\u305d\u306e\u60c5\u5831\u3092\u6587\u5b57\u5217\u306b\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u610f\u3057\u305f\u3002<\/p>\n<div class=\"code\">public class Vertex {<br \/>\n  int x;<br \/>\n  int y;<br \/>\n  int z;<br \/>\n  public Vertex(int x0, int y0, int z0) {<br \/>\n    setValue(x0, y0, z0);<br \/>\n  }<br \/>\n  public void setValue(int x0, int y0, int z0) {<br \/>\n    x = x0; y = y0; z = z0;<br \/>\n  }<br \/>\n  public String toString() {<br \/>\n    return &#8220;(x, y, z)=(&#8220;+x+&#8221;, &#8220;+y+&#8221;, &#8220;+z+&#8221;)&#8221;;<br \/>\n  }<br \/>\n}<\/div>\n<p>\u6b21\u306b\u3001\uff13\u6b21\u5143\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8868\u3059\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9\u3092\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u307f\u308b\u3002\u307e\u3041\u3001\u3068\u308a\u3042\u3048\u305a\u63cf\u753b\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308c\u3070\u3044\u3044\u3060\u308d\u3046\u304b\u3002<\/p>\n<div class=\"code\">public interface Object3d {<br \/>\n  public void draw();<br \/>\n}<\/div>\n<p>\u6b21\u306b\u76f4\u7dda\u3092\u8868\u3059\u30af\u30e9\u30b9\u3092\u7528\u610f\u3057\u3066\u307f\u3088\u3046\u30022\u70b9\u304c\u6c7a\u307e\u308c\u3070\u76f4\u7dda\u306f\u6c7a\u307e\u308b\u306e\u3067\u3001\u305d\u306e\u60c5\u5831\u3092\u6301\u3064\u3088\u3046\u306b\u3057\u3066\u307f\u305f\u3002\u63cf\u753b\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u3068\u308a\u3042\u3048\u305a\u9802\u70b9\u5ea7\u6a19\u3092\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3002\u3053\u308c\u3067\u4e00\u5fdc\u306e\u78ba\u8a8d\u306f\u3067\u304d\u308b\u306f\u305a\u3060\u3002<\/p>\n<div class=\"code\">public class Line implements Object3d{<br \/>\n  Vertex v0;<br \/>\n  Vertex v1;<br \/>\n  public Line(int x0, int y0, int z0, int x1, int y1, int z1) {<br \/>\n    v0 = new Vertex(x0, y0, z0);<br \/>\n    v1 = new Vertex(x1, y1, z1);<br \/>\n  }<br \/>\n  public void draw() {<br \/>\n    System.out.print(&#8220;Line:&#8221;);<br \/>\n    System.out.print(&#8220;v0:&#8221;+v0.toString());<br \/>\n    System.out.print(&#8221; &#8211; &#8220;);<br \/>\n    System.out.print(&#8220;v1:&#8221;+v1.toString());<br \/>\n    System.out.println(&#8220;&#8221;);<br \/>\n  }<br \/>\n}<\/div>\n<p>\u6700\u5f8c\u306e\u30af\u30e9\u30b9\u306f\u30c6\u30b9\u30c8\u7528\u306e\u30af\u30e9\u30b9\u3060\u3002\u307e\u305a\u306f\u3001\u601d\u3063\u305f\u3068\u304a\u308a\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u4f5c\u3059\u308b\u304b\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3002<\/p>\n<div class=\"code\">public class Starter {<br \/>\n  public static void main(String[] args) {<br \/>\n    Object3d obj;<br \/>\n    obj = new Line(1,1,1,3,3,3);<br \/>\n    obj.draw();<br \/>\n    obj = new Line(1,2,3,2,4,6);<br \/>\n    obj.draw();<br \/>\n  }<br \/>\n}<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Java\u306b\u3088\u308b\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u306e\u57fa\u790e\u306b\u3064\u3044\u3066\u3001\u601d\u3044\u3064\u304f\u307e\u307e\u306b\u66f8\u3044\u3066\u307f\u3088\u3046\u3068\u601d\u3046\u3002 \u307e\u305a\u306f\u9802\u70b9\u3092\u8868\u73fe\u3059\u308b\u3068\u3053\u308d\u304b\u3089\u3060\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-623","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/comments?post=623"}],"version-history":[{"count":0,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/623\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/media?parent=623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/categories?post=623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/tags?post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}