Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (784)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3 4 ... 10
 11 
 on: 2017-02-18 17:23:38 
Started by BurntPizza - Last post by FabulousFellini
We used to call cocaine twat powder here. Because it turns ordinary people into twats.

Cas Smiley

Yeah most people turn into twats.  At the recording studio I used to work at, one of the engineers snorted 60k of the studio's money.  Then the owner found out, and it was not a pretty day that day.

 12 
 on: 2017-02-18 17:19:29 
Started by BurntPizza - Last post by princec
We used to call cocaine twat powder here. Because it turns ordinary people into twats.

Cas Smiley

 13 
 on: 2017-02-18 16:53:02 
Started by ral0r2 - Last post by ral0r2
I figured this out, thank you!
No clue if this is the smartest way tho:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
public static void updateTMXforObjectLayer(String fileName) throws SAXException, IOException, ParserConfigurationException, TransformerException {
      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
     
      Document doc = docBuilder.parse("src/main/resources/maps/"+fileName);
      NodeList list = doc.getElementsByTagName("objectgroup");
      if(list != null){
     
      Element el = null;
      for(int i = 0; i < list.getLength(); i++){
      el   = (Element) list.item(i);
      el.setAttribute("id", "1");
      el.setAttribute("height", "1");
      el.setAttribute("width", "1");
      }
     
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty(OutputKeys.METHOD, "xml");
        DOMSource source = new DOMSource(doc);
        StreamResult result = new StreamResult(new File("src/main/resources/maps/"+fileName));
      transformer.transform(source, result);
      }
   }

 14 
 on: 2017-02-18 16:35:11 
Started by BurntPizza - Last post by FabulousFellini
Chuck it in the bin. Seriously. No good ever comes of white powdered drugs.

Cas Smiley

Oh I know!  I took it home to show my wife and threw it out.

 15 
 on: 2017-02-18 16:22:30 
Started by orogamo - Last post by vfmachado
If you are new to modern OpenGL and knows Java. I recommend you to looking for ThinMatrix on Youtube.

https://www.youtube.com/playlist?list=PLRIWtICgwaX0u7Rf9zkZhLoLuZVfUksDP

These tutorials are old for the LWJGL concepts (it uses LWJGL 2). But for the OpenGL stuff it's really nice, he talks straightforward  about different concepts in a game development using Java and OpenGL

I started 3 months ago using the BennyBox game engine tutorials series... and now I'm adding more things from these series from ThinMatrix.

I hope I have helped you...

 16 
 on: 2017-02-18 16:06:03 
Started by BurntPizza - Last post by princec
Hah, so it is of course.

Cas Smiley

 17 
 on: 2017-02-18 16:05:05 
Started by BurntPizza - Last post by theagentd
Try the average of the 3 verts as the sort key.

Cas Smiley
It's the exact same thing. The average is (i1 + i2 + i3) / 3, so I'm just sorting based on <average>*3.

 18 
 on: 2017-02-18 15:58:37 
Started by BurntPizza - Last post by princec
Try the average of the 3 verts as the sort key.

Cas Smiley

 19 
 on: 2017-02-18 15:22:46 
Started by BurntPizza - Last post by theagentd
I seem to recall years and years ago getting perfectly decent performance optimisation just by the simple expedient of sorting triangles in order of their average vertex index number. And that's O(n log n) perf on average. It's not quite as fancy but it gets like 90% of the win for bugger all effort and the best bit is that it can be done in realtime with dynamic meshes. Food for thought. (Why not try it and compare?)

Cas Smiley
Actually, the first thing I did was sort based on the lowest index number. It couldn't compare to Tom's algorithm. Hmm... I'm gonna try something similar though.


EDIT: So I tried something really simple:

1. Sort triangles based on (i0 + i1 + i2).
2. Reorder vertices in the order they are used by the triangles (= the pre-transform cache coherency optimization, step 3 in my previous long post).
3. Repeat until the result gets stable.

The result was actually pretty good, but still not as good as Tom Forsyth's algorithm.

Quote
Simple algorithm after 86 iterations: invocations: 38544 --> 26902 --> 14308 (62.878788% reduction, 54.71454% more than optimal)
Tom Forsyth's algorithm: 38544 --> 26902 --> 11904 (69.115814% reduction, 28.719727% more than optimal)

EDIT 2: According to Forsyth, his algorithm can be implemented in linear time.

EDIT 3: Note that all the invocations counts are reported by the hardware of my Nvidia GPU. The numbers may be very different on AMD and Intel GPUs.

 20 
 on: 2017-02-18 15:21:27 
Started by orogamo - Last post by orogamo
I have recently started programming in java again after about a year doing other stuff.
Now I wanted to refurbish an old engine I had laying around.

I upgraded it from OpenGL 1.1/Immediate mode, to OpenGL 3.2 Core.
But for some reason it won't display the vertices(I am completely new to Modern OpenGL).

If someone could take a look and help, I would greatly appreciate it ^_^

Affected source code:
Gist: View on Github Gist
Source Code: Download (OneDrive)

Edit:
I have also tested with a simple Triangle, and still nothing...
Reference I used: https://github.com/SilverTiger/lwjgl3-tutorial/wiki/Rendering


EDIT 2:
I figured it out...
I set the perspective matrix zNear to negative value  Emo , while it should be above 0
This:
1  
matrixPerspective = Matrix4f.perspective(45, ratio, -1f, 1024f);

should be something like this:
1  
matrixPerspective = Matrix4f.perspective(45, ratio, 0.1f, 1024f)



Pages: 1 [2] 3 4 ... 10
 
theagentd (64 views)
2017-02-18 13:42:33

theagentd (69 views)
2017-02-18 13:35:16

h.pernpeintner (1233 views)
2017-01-24 22:39:11

h.pernpeintner (1221 views)
2017-01-24 22:38:32

Galdo (1765 views)
2017-01-12 13:44:09

Archive (1889 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2425 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2277 views)
2016-12-15 21:50:57

Lunch (2358 views)
2016-12-06 16:01:40

ral0r2 (2151 views)
2016-11-23 16:08:26
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!