• Content count

  • Joined

  • Last visited

Community Reputation

149 Neutral

About carloscruz

  • Rank
  1. WASCANA is not continued anymore. I will test MinGW Developer Studio. Moderator, please delete this topic if you want. Thank you. ------ question was: I installed MSVC2008 and it came with .Net 3.5 and ocuppied more than 300MB for what I believed to be an aesy and slim IDE (but it has too much own macros and defs, far from ANSI/C from what I could see at a superficial level). Wascana is too since it is built over Eclipse's IDE. How bad is to use Wascana to develop cross-platform games and which APIs it does not have support? Thank you.
  2. [quote name='kunos' timestamp='1352476121' post='4999325'] [quote name='Caburé' timestamp='1352475204' post='4999314'] That was a rethorical question, I already knew how to create a static class in Java. [/quote] [img][/img] who said anything about static classes? My entire point is to avoid static stuff actually [img][/img] . What I meant was, what do you use to store your precomputed values? A standard class, plain and simple. [/quote] Yes, you are right.
  3. [quote name='swiftcoder' timestamp='1352475841' post='4999320'] [quote name='Caburé' timestamp='1352475204' post='4999314'] That was a rethorical question, I already knew how to create a static class in Java.[/quote] He's not talking about a static class, he's talking about a normal class. Static data comes with many of its own pitfalls, even when that static data isn't truly global. [/quote] (I mean Java) if I put a public static final int x = 1; in any normal class, that class is both global and static: is immutable because must hold the final value in at least one of its fields.. even without having static fields, in Java. Every class in Java is static. Not every instance.
  4. Global variable is already bounded in a scope.. do you mean that, when someone uses an API, all its singletons used internally must be visible for the programmer? I don't believe. Ok. You refer a design pattern. I was dumb and did not payed enough attention to it in the first post, in the beginning of the topic, sorry.
  5. [quote name='kunos' timestamp='1352474390' post='4999310'] [quote name='Caburé' timestamp='1352473348' post='4999305'] How would you store, for example, trigonometry tables? [/quote] class TrigonometryTables { ... } [img][/img] It DOES NOT HAVE to be one. If your application only needs one, you application will instance it once and make it available to its subsystems. In other words: why making assumptions on an application behavior if you dont have to? [/quote] That was a rethorical question, I already knew how to create a static class in Java. You mean why don't copy/paste Sun's/Oracle's formal definitions ? Because I thought it is a forum to interchange experience (this is rethoric again), not conceptual aspects of formal oop inspired by how philosofically the real world binds into the structure of a program and how beautiful it may become, in the aspect of fitting in the common-use of objects, the reference to singleton classes within the code. I just said how I like to use singletons: reutilization of already created metadata valid in global level,everytime, with no specific meaning (and metadata doesn't have a context specific to an object but is the result of interactions of them, having no fit within them without extra-redesign). If the topic is how pretty it fits into the aspects of OOP... the name of the topic should be changed to "why do we still need to use singletons when it is conceptually outside the formal view of the floating round world of objects, resembling old days of procedural programming?". I just answered the topic. If it fits or not the formal definitions of a design pattern instead of what the term means by itself.. that is another issue.
  6. [quote name='kunos' timestamp='1352472507' post='4999300'] [quote name='Caburé' timestamp='1352472139' post='4999297'] METADATA: There are many times when a program needs to store and reference data that is a result of processing and that can be used again. How will you store metadata? I like to use singletons for structural/constant data/flags/metadata(temporary) instances, when the complexity of creating new instances and having it loading its data from something/somewhere doesn't worth as simply acessing it straight like cache of processors is used and Windows Registry (always in memory). [/quote] sorry it doesn't float at all. It doesn't have to be a ONE! You create it ONCE, and pass it around or publish it to objects interested in it. You are talking about trading memory for computation costs.. it doesn't have anything to do with SINGLENESS and globality of scope. [/quote] Singleton is single instance. It does not necessarily mean global scope (you can create a singleton in the scope of a package, for example). Singleton is static - that is why there is a static word in Java (and not, again, necessarily, a global pointer/variable). If you could reraise the data of a singleton just by making a new instance without costs, what would be the reason to use static classes (singleton) - that is what I am explaining? How would you store, for example, trigonometry tables? If you can't see that, every time you declare a public static final int, the class where you declared it becomes a singleton, conceptually: is accessible in global scope and has only one static instance - the class itself. In Java, you can even set/change static variables at runtime (but not final variables). I just said how I like to use SingleTons : to store metadata. I didn't argue that it is the only way to do that. But.. ppl seem to be stuck in just one technique. After all, I am posting in the wrong place, I forgot to tell that I was meaning Java as programming language.
  7. METADATA: There are many times when a program needs to store and reference data that is a result of processing and that can be used again. How will you store metadata? I like to use singletons for structural/constant data/flags/metadata(temporary) instances, when the complexity of creating new instances and having it loading its data from something/somewhere doesn't worth as simply acessing it straight like cache of processors is used and Windows Registry (always in memory).
  8. How powerful is Java?

    I am not saying java is bad or worse. It is different. I'll try to explain what I've got trying to use both OOP and needed software graphics simple operations as arraycopy and simple mean, additions/subtractions for bright/contrast (without hardware acceleration). In Java, you can't control things at the hardware level (you can just prepare data to send to it): you just write and hope it to run at reasonable speed and Java doesn't have accurate timers - even a diference of time can't be assured to be real. Example: // compares two moments, in miliseconds long time1 = System.currentTimeMilis(); anObject.doThings(); long timeElapsedMs = System.currentTimeMilis() - time1; System.out.println(timeElapsedMs); //-------------- The time shown above can't be trusted to be exact about the time ran. I was once trying to use math to make a sequence of events to become stable by skipping fixed periods of time based on a known variation and sleeps, shifting from slow to fast to make all run in the expected framerate and I could not make it work because the time difference always were over a limit of ˜8FPS (1000/8 = 120 ms) USING System.ArrayCopy (supposed to be the fastest way) - the job was to copy to a buffered image pixels the pixels of a source buffer, in the same format: Java schedules memory reallocation and garbage collection while in the loop and, for being so oriented to objects, I could never know when Java was bouncing the top amount of memory needed to keep the animation/reallocation (I tried to cut all to a fixed size copy/paste of memory) but for every single aspect, even to get current timedate you need a new object - new Date( ), for example. In the withins, Java creates many more objects. If you rely on that, your perfect Java written code may (may) become a powerful... resource eater. If you need precision, you must rely on hardware. Relying on hardware makes that assumption about "compile once, run anywhere" worse: C/C++ can be used to run software that binds straight to the OS, without balances and fixed panorama about a basic architeture and reasonable speed conform that design. Reasonable speed conform the design is something that must be very good in Java Code for you to have a good result if you pretend to port applications.
  9. How powerful is Java?

    Java offers ways to process pixels fast using BufferedImage. I've made this sample to test it (2D): [media][/media] There is just one character and effects made straight to the pixels. I believe that, if things should have been spread through other objects, it could need a redesign to take advantage of architetural aspects as how loops and other predictions and metadata creation are made.
  10. How powerful is Java?

    Many functions of Java rely on the utilization of API that are not specilalized (like using BufferedImages and 2D GUI Api to draw sprites). Depending on which API you will use, your game may consume many more memory than necessary and go much slower than you would expect. The compiler+language+architeture are not a deal but how they are binded with some technologies(API) makes a HUGE difference. I don't like to be forced to use (b & 0xff) for every byte to be able to know its integer value (to the hardware it donesn't need that operation but whenever the data need to be known or parsed it will have to be translated to more common values, if you like to use more known constants). Data are not data.. you can't just cast things because they are encapsulated in round/closed solutions called classes... and they require you to use paths to deal with them: functions.. and java functions can be tedious since you may lose speed if you are heavy user of objects.. Java is not for speed. Is for portability and facilities(web). What you see as graphical results comparing Java and C/C++ is just the work of native graphics API/drivers receiving the necessary data at a constant rate. And the data received by OpenGL, for example, must match its requirements and I don't know if the java interface doesn't shift things before sending to the drivers. Memory: you don't know how much memory an object will take and how worse it can get when you use third-party objects made for other kinds of solutions (not specialized in your case/solution) when you just use a bunch of them (Java is good using arraylists to store objects, not arrays - as records/structures..). In Java, all turns to facilitate the alignment in memory: I believe that most of the speed Java has is because the compiler hides what he does do store your, for example, stricted 3 byte data in 4 bytes in memory, wasting one byte just to have easy access, and how big is the speculation of the amount of memory needed for your JVM when you allocate memory: if you read a 30MB file, the JVM will request more than 80MB to the OS, trying to facilitate things for the programmer by speculation to the "future".. the flawless impression that Java does costs memory because when there is no more memory, your virtual machine/application just stalls and you have nothing more to do (even freeing objects won't make you able to continue, by how I use to face). There is the garbage collector but it is more to a unspecialized guardian of presumable roads through what you may go or not, trying to let out of the oval circuit of memory reutilization the "stones" that your last lap had left and that you are maybe still using... lost threads sometimes are part of those.. but it is not easy to have a virtual clean and opened highway in front of you when you don't have ways to know in what speed you'll go (I mean dynamic memory utilization) because only the JVM knows where to store what you need.. and aligned in 4 bytes.. always.. per object (if you have a thousand objects of 3 bytes, you'll lose a thousand bytes if you store it in objects - if it is good or not, is up to you to know). You may notice that if the project made in Java acts like a known tree, having all its growth process presumed and repeating it everytime, the JVM will not have so many issues about memory or the lack of speed that some facilitations that high level languages offer and that it is up to the programmer to make code that will slimly fit into the sharp requisites of API, working perfectly in the electric level of seam between the software conceptions and its overheads and the hardware immediate needs and characteristics but.. take care about what Java hides..
  11. Reusing VBOs (or lists)

    Thank you very much. I'll take a look and study that.
  12. [b]TOPIC IMPLICITLY CLOSED WHILE I STUDY TRANSFORMATION MATRICES[/b] - THANKS -------------- Ok, short: [color=#006400][b]I would like to render trees. Fast. Using geometry + textures.[/b][/color] [color=#b22222]How to do that without making a single model in VBO or other list and trying to reuse that over a heightmap?[/color] First question: I don't know how ([color=#ff0000]and I have already searched[/color]) to take a fixed geometry stored in fast memory and repaint that in another place for reuse. I mean: take a tree and draw it at x,y,z and at x+5, y+2, z+1 since the global position of the vertexes are already set [b]IN THE MEMORY of the VBO[/b]. If I can do the above, the problem could be easily resolved by[color=#0000cd][u][i] breaking down the possible variations of trunks, leaves and geometry of the trees and reusing those and those textures everytime, saving a whole world of memory[/i][/u][/color]. How can I do that, may someone help me? [u][color=#000000][b]If you want to answer just one question:[/b][/color][/u] [u][color=#000000][b]Can I redraw a VBO at a relative position?[/b][/color][/u] Thank you very much.
  13. OpenGL The maths behind the rotations

    This answer is not specifically to the parner who made the question. Might even be for myself. Man, the hardware just makes an illusion, after all. Don't get nuts about that or about how hard it is to grip the source of an specific equation/function as if you had to imagine it based on its results instead of how it works in a specific case, binded for a purpose (math alone is steryle but is amazing when joins its functions in a purpose to work as an [color=#ff0000][b]analogy of the nature - in this case, resulting graphical analogy in heterogeneous equations [/b][/color]). What those funcions have worthing (trigonometric) is that they return something between a range in a fixed way (what comes x goes out y, always), bouncing from up to down (or left/right, back/forth, -1..1, sun and moon, black to white, whatever defined and represented as a - mostly required smooth- transition). What you see in the screen is a composition resulting from a specific time changing parameters that result in a scene created ( I am not going out of the scope since the "bones" of the issue ARE the mathematical functions). A simulation as how hardware works is no magic but a bunch of tricks and those trigonometric functions are nothing but this: [media][/media] ACTUALLY a bounce. ACTUALLY. Other kinds of functions represent (because they act as) other natural phenomenons (as a steady grow in 2 dimensions done by a square or three dimension done by a cube), going parallel (as simulation) to what happens in nature, chained to other functions based on natural results of natural interactions of the aspect (variable) you are seeking for. That is directed/aimed functionality (with functions being its "artifacts", not its purpose - despite being a purpose as language to computers). You may not grip the math as a plotted dropping results of specific variables flowing thorugh functions to define spatial conditions because it renders too fast. If you could see the rendering not as fast, you could then see how the interactions lead the results into known ways of using trigonometry to simulate movement (riding a bicycle is somewhat like - you know the steps but speed makes it work). Don't fall into the functions as if they were an "identity of a transformation" by its declaration but take it slow to see that every piece of a function is an independent possibility bounded specifically to act as a part of a simulation of phenomenon either in literal meanings (direct rendering) or flow control (function direction/parameter). What you see in an algebric expression is an articulation or an identity to a natural event at last, in its minimal aspect known/identifiable. There is no physical limit for simulation. [b]Don't get functions as fetish without understanding its limits and how they are connected and the pratical purpose.[/b] The results you see is just the attenuations/vectorizations(perspective adjustments) of the same functions based on another variations, all computed in a way to APPEAR that there is a WORLD being drawn and not just "[b]chained reactions of known results based on observed motions in reality that goes in just ONE DIMENSION for EACH VARIABLE[/b], positioned in a 2 dimensional space. [color=#0000ff][b]2 (even for 3D graphics)[/b][/color].". Don't grip the world, the simulation is[b] PURE ARTIFACT of reality, made by mind[/b]. Don't go believing that there is a magic for "deep simulation" in the functions because there is no deep, just a parameter changing how a variable changes based on a simbology that turns a number into a fraction of another and THAT IS THE MAGIC: A number changing others based on its own value and by that change in especific and isolated variables, shifting up/down, reducing lengths of lines, affecting sizes, TURNING/TREATING X into/as Z, Z into/as Y, Y into/as X and causing the effect of rotation/flipping based on simple substitution (each matrix used can use [color=#ff0000][b]anything as anything[/b][/color], by any parameters based on any source - anything in this case is NUMBERS that can be [color=#ff0000]vectors/scalars or those "normals"[/color] that put z into z, x into x and y into y again [color=#ff0000][b]to close the circus[/b][/color]). I swear again: THERE IS NO REAL TRANSLATION, DEPTH, SCALE, ROTATION or whatever: what you see is a number changing another number to appear a scene, all based on an immitation of what would happen in reality (the "world" is just a relation between functions: [color=#006400][i]no matter how beautiful or weird an equation/function may appear because it doesn't work by itself and if the real condition from where it was concepted changes, the equation might change too - the conception of a function is the real art/synthesis, its utilization as graphics is, amazingly, [b]just artifact of math - in analogy to nature[/b][/i][/color]). If algebra is like the sun for you, [b][color=#ff8c00]don't look at the sun[/color][/b]. See how it was made and you might understand (the many aspects of reality that math simulates and how they join to result in a variable). Your vision shall not be the same as the Marionette (I hope) but the handler (who has nothing more than a few strings and sticks but, by his hability, can make a beautiful world to entertain people - math just have numbers and its transformations.. single or chained functions based on nature, or not): [media][/media] Sorry for my way of explaining, might not be good but, may help.