Difference between revisions 1313 and 1314 on hiwikiversity{{कंप्यूटर ग्राफिक्स -- 2013-2014 -- info.uvt.ro/पेज हैडर}} == पूर्ण उदाहरण == दो उदाहरण टेम्पलेट्स यहां दिए गए हैं। एक ऑर्थोग्राफिक प्रोजेक्शन का उपयोग दृश्यों के लिए और एक पर्सपेक्टिव प्रोजेक्शन का उपयोग दृश्यों के लिए। उदाहरणों को भविष्य के जीओजीएल(JOGL) आधारित एप्लीकेशन के लिए टेम्पलेट्स के रूप में इस्तेमाल किया जा सकता हैं। === ऑर्थोग्राफिक प्रोजेक्शन उदाहरण === <source lang="java"> import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.fixedfunc.GLMatrixFunc; import javax.swing.JFrame; import com.jogamp.opengl.util.Animator; public class MainFrame extends JFrame implements GLEventListener { private GLCanvas canvas; private Animator animator; // For specifying the positions of the clipping planes (increase/decrease the distance) modify this variable. // It is used by the glOrtho method.क्लिपिंग प्लेन की स्थिति को निर्दिष्ट करने के लिए (दूरी में वृद्धि/कमी करें) इस चर को संशोधित करें //यह glOrtho method द्वारा उपयोग किया जाता है private double v_size = 1.0; // Application main entry pointएप्लीकेशन मैन प्रवेश बिंदु public static void main(String args[]) { new MainFrame(); } // Default constructorडिफ़ॉल्ट कन्स्ट्रक्टर public MainFrame() { super("Java OpenGL"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(800, 600); this.initializeJogl(); this.setVisible(true); } private void initializeJogl() { // Creating a new GL profile.एक नया जीएल प्रोफाइल बनाना GLProfile glprofile = GLProfile.getDefault(); // Creating an object to manipulate OpenGL parameters.ओपनजीएल पैरामीटर में हेरफेर करने के लिए ऑब्जेक्ट बनाना GLCapabilities capabilities = new GLCapabilities(glprofile); // Setting some OpenGL parameters.कुछ ओपनजीएल पैरामीटर सेट करना capabilities.setHardwareAccelerated(true); capabilities.setDoubleBuffered(true); // Try to enable 2x anti aliasing. It should be supported on most hardware.2x एन्टी अलियासिंग सक्षम करने का प्रयास करें यह अधिकतर हार्डवेयर पर समर्थित होना चाहिए। capabilities.setNumSamples(2); capabilities.setSampleBuffers(true); // Creating an OpenGL display widget -- canvas.एक ओपन जीएल डिस्प्ले विजेट बनाना - कैनवास this.canvas = new GLCanvas(capabilities); // Adding the canvas in the center of the frame.फ्रेम के केंद्र में कैनवास जोड़ना this.getContentPane().add(this.canvas); // Adding an OpenGL event listener to the canvas.कैनवास के लिए एक ओपन जीएल इवेंट श्रोता को जोड़ना this.canvas.addGLEventListener(this); // Creating an animator that will redraw the scene 40 times per second.एक एनीमेटर बनाना जिससे स्क्रीन प्रति सेकंड 40 बार प्रतिलिपि होगा। this.animator = new Animator(this.canvas); // Starting the animator.एनीमेटर शुरू करना this.animator.start(); } public void init(GLAutoDrawable canvas) { // Obtaining the GL instance associated with the canvas. GL2 gl = canvas.getGL().getGL2(); (contracted; show full) } } </source> [[Category:HI]] [[Category:कंप्यूटर ग्राफिक्स]] [[Category:प्रोग्रामिंग उदाहरण]] All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://hi.wikiversity.org/w/index.php?diff=prev&oldid=1314.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|