Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  wireframe mode  (Read 2057 times)
0 Members and 1 Guest are viewing this topic.
Offline Middy

Junior Member




Java games rock!


« Posted 2003-08-20 19:54:58 »

Is it possible?

When do I get my makeMyGameAsILike() extension?
Offline Mac_Systems

Junior Member




I love my Java


« Reply #1 - Posted 2003-08-20 20:13:40 »

Erm ?

Please specify your question a bit more precise  Grin

Sure is Wireframe rendering possible ...

- Jens

The Network is the Music
http://www.mac-systems.de
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #2 - Posted 2003-08-20 22:55:22 »

Do you mean:

glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

??

If so... yes. You can do that.

Don't send a man to do a monkey's work.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Chman

Junior Member




Nothing more that... Java games are cool !


« Reply #3 - Posted 2003-08-21 08:20:25 »

And to switch back to solid mode, use :

glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

Smiley
++
Chman
Offline Middy

Junior Member




Java games rock!


« Reply #4 - Posted 2003-08-21 08:39:13 »

I want to render my aster with a vireframe instead of filled quadrants


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
package dts.client.impspace;

import org.lwjgl.opengl.GL;

import dts.client.e3d.StaticModel;
import dts.client.e3d.Texture;
import dts.client.e3d.Coord;

public class Aster extends StaticModel {
     
      private double _radius;      
      private Texture _texture;
      private int            _n=100;//precision of grade divisions
     private Coord _coord = new Coord(0.0f,0.0f,0.0f);
      public Aster(float radius,Texture texture)
      {
            super();
            //setRotation(new Coord(-90.0f,1.0f,0.0f));
           _radius=radius;
            _texture=texture;
            compile();
      }
     
      public void compile()
      {
            GL.glNewList(_handle,GL.GL_COMPILE);
            GL.glColor3f(1.0f,1.0f,1.0f);
            this.render(0);
            GL.glEndList();
      }
     
      public void draw(long t)
      {
            //processPosition();
           GL.glColor3f(1.0f,1.0f,1.0f);
            GL.glCallList(_handle);
      }
     
      public void render(int mode)
      {
            super.render(mode);
// TODO : redo without GLU            int quadric=GLU.gluNewQuadric();
//            GLU.gluQuadricNormals(quadric,GLU.GLU_SMOOTH);
//            GLU.gluQuadricTexture(quadric, true);
           _texture.bind();
//            GLU.gluSphere(quadric,_radius,60,60);
           
            //dont want to change varible name lazy
           double r      = _radius;
            int n      = _n;
            Coord  c      = _coord;
           
            final double PI       = Math.PI;
            final double TWOPI = Math.PI *2.0f;
            final double PID2       = Math.PI * 0.5f;

            int i,j;
            double theta1,theta2,theta3;
            //Coord e,p;
           Coord e= new Coord();
            Coord p= new Coord();
           
            if (r < 0)
                  r = -r;
            if (n < 0)
               n = -n;
            if (n < 4 || r <= 0) {
               GL.glBegin(GL.GL_POINTS);
               GL.glVertex3f(c.getX(),c.getY(),c.getZ());
               GL.glEnd();
               return;
            }
            for (j=0;j<n/2;j++) {
               theta1 = j * TWOPI / n - PID2;
               theta2 = (j + 1) * TWOPI / n - PID2;

               GL.glBegin(GL.GL_QUAD_STRIP);
               for (i=0;i<=n;i++) {
                    theta3 = i * TWOPI / n;
             
                    e.setX((float)(Math.cos(theta2) * Math.cos(theta3)));
                    e.setY((float)(Math.sin(theta2)));
                    e.setZ((float)(Math.cos(theta2) * Math.sin(theta3)));
                    p.setX((float)(c.getX() + r * e.getX()));
                    p.setY((float)(c.getY() + r * e.getY()));
                    p.setZ((float)(c.getZ() + r * e.getZ()));

                    GL.glNormal3f(e.getX(),e.getY(),e.getZ());
                    GL.glTexCoord2f(i/(float)n,2*(j+1)/(float)n);
                    GL.glVertex3f(p.getX(),p.getY(),p.getZ());

                    e.setX((float)(Math.cos(theta1) * Math.cos(theta3)));
                    e.setY((float)(Math.sin(theta1)));
                    e.setZ((float)(Math.cos(theta1) * Math.sin(theta3)));
                    p.setX((float)(c.getX() + r * e.getX()));
                    p.setY((float)(c.getY() + r * e.getY()));
                    p.setZ((float)(c.getZ() + r * e.getZ()));

                    GL.glNormal3f(e.getX(),e.getY(),e.getZ());
                    GL.glTexCoord2f(i/(float)n,2*j/(float)n);
                    GL.glVertex3f(p.getX(),p.getY(),p.getZ());
               }
               GL.glEnd();
            }
      }
}

When do I get my makeMyGameAsILike() extension?
Offline Middy

Junior Member




Java games rock!


« Reply #5 - Posted 2003-08-21 08:43:11 »

nm added this and it worked

[code]GL.glPolygonMode(GL.GL_FRONT_AND_BACK,GL.GL_LINE);
[/CODE]

When do I get my makeMyGameAsILike() extension?
Offline Middy

Junior Member




Java games rock!


« Reply #6 - Posted 2003-08-21 09:01:23 »

heh... next question.. if I want to show the wires as well as the texture... how would I proceed.. I plan to use the wires and longtitude and latitude

When do I get my makeMyGameAsILike() extension?
Offline princec

JGO Kernel


Medals: 361
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2003-08-21 12:55:36 »

Draw it twice; once with textures, the second time, using line mode.

Cas Smiley

Offline Middy

Junior Member




Java games rock!


« Reply #8 - Posted 2003-08-21 13:40:07 »

Changed it to this... I render it twice.. but should i create two asters?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
package dts.client.impspace;

import org.lwjgl.opengl.GL;

import dts.client.e3d.StaticModel;
import dts.client.e3d.Texture;
import dts.client.e3d.Coord;

public class Aster extends StaticModel {
     
      private double _radius;      
      private Texture _texture;
      private int            _n=50;//precision of grade divisions
     private Coord _coord = new Coord(0.0f,0.0f,0.0f);
      public Aster(float radius,Texture texture)
      {
            super();
            //setRotation(new Coord(-90.0f,1.0f,0.0f));
           _radius=radius;
            _texture=texture;
            compile();
      }
     
      public void compile()
      {
            GL.glNewList(_handle,GL.GL_COMPILE);
            GL.glColor3f(1.0f,1.0f,1.0f);
            this.render(1);
            this.render(0);
           
            GL.glEndList();
      }
     
      public void draw(long t)
      {
            //processPosition();
           GL.glColor3f(1.0f,1.0f,1.0f);
            GL.glCallList(_handle);
      }
     
      public void render(int mode)
      {
            super.render(mode);
// TODO : redo without GLU            int quadric=GLU.gluNewQuadric();
//            GLU.gluQuadricNormals(quadric,GLU.GLU_SMOOTH);
//            GLU.gluQuadricTexture(quadric, true);
           _texture.bind();
//            GLU.gluSphere(quadric,_radius,60,60);
           
            //dont want to change varible name lazy
           double r      = _radius;
            int n      = _n;
            Coord  c      = _coord;
           
            final double PI       = Math.PI;
            final double TWOPI = Math.PI *2.0f;
            final double PID2       = Math.PI * 0.5f;
            if (mode==1)GL.glPolygonMode(GL.GL_FRONT_AND_BACK,GL.GL_LINE);
           
            if(mode==0)GL.glPolygonMode(GL.GL_FRONT_AND_BACK,GL.GL_FILL);

            int i,j;
           
            double theta1,theta2,theta3;
            //Coord e,p;
           Coord e= new Coord();
            Coord p= new Coord();
           
            if (r < 0)
                  r = -r;
            if (n < 0)
               n = -n;
            if (n < 4 || r <= 0) {
               GL.glBegin(GL.GL_POINTS);
               GL.glVertex3f(c.getX(),c.getY(),c.getZ());
               GL.glEnd();
               return;
            }
            for (j=0;j<n/2;j++) {
               theta1 = j * TWOPI / n - PID2;
               theta2 = (j + 1) * TWOPI / n - PID2;

               GL.glBegin(GL.GL_TRIANGLE_STRIP);
               for (i=0;i<=n;i++) {
                    theta3 = i * TWOPI / n;
             
                    e.setX((float)(Math.cos(theta2) * Math.cos(theta3)));
                    e.setY((float)(Math.sin(theta2)));
                    e.setZ((float)(Math.cos(theta2) * Math.sin(theta3)));
                    p.setX((float)(c.getX() + r * e.getX()));
                    p.setY((float)(c.getY() + r * e.getY()));
                    p.setZ((float)(c.getZ() + r * e.getZ()));

                    GL.glNormal3f(e.getX(),e.getY(),e.getZ());
                    GL.glTexCoord2f(i/(float)n,2*(j+1)/(float)n);
                    GL.glVertex3f(p.getX(),p.getY(),p.getZ());

                    e.setX((float)(Math.cos(theta1) * Math.cos(theta3)));
                    e.setY((float)(Math.sin(theta1)));
                    e.setZ((float)(Math.cos(theta1) * Math.sin(theta3)));
                    p.setX((float)(c.getX() + r * e.getX()));
                    p.setY((float)(c.getY() + r * e.getY()));
                    p.setZ((float)(c.getZ() + r * e.getZ()));

                    GL.glNormal3f(e.getX(),e.getY(),e.getZ());
                    GL.glTexCoord2f(i/(float)n,2*j/(float)n);
                    GL.glVertex3f(p.getX(),p.getY(),p.getZ());
               }
               GL.glEnd();
            }
      }
}

When do I get my makeMyGameAsILike() extension?
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (23 views)
2014-08-19 09:29:53

Tekkerue (22 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (57 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (36 views)
2014-08-06 19:49:38

BurntPizza (66 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!