Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

326 Neutral

About AsOne

  • Rank
  1. AsOne

    What IDE are YOU using?

    Vim... arrow keys? A mouse? Are you guys crazy? But honestly, mostly vim with a terminal emulator. Sometimes Eclipse for Java related work and Carbide.c++ (I guess really Eclipse) for Symbian development. Most work done on Linux (Ubuntu and Arch), some on Windows XP (usually virtualized).
  2. AsOne

    Hilarity In Video Games

    Quote:Original post by Mike.Popoloski "Do a barrel role!" Haha, was that the original StarFox or the 64 one?
  3. AsOne

    Texture Mapping Triangles

    I think I gave a bad explanation. I'm actually loading a non-compiled map file (map extension). Each brush is given as a series of intersecting planes and I am generating triangles from this data. What I meant about the quad is that, to generate the triangles I create a quad on the surface of one of the planes and then clip it against all the other planes in the brush generating a face. What I don't know how to do is apply a texture to the face (some number of triangles) after it's been clipped so the texture is correct. JuNC: It sounds like I need to be computing the texture co-ordinates while clipping each quad, and not figure them out during rendering, is this correct? [Edited by - AsOne on September 6, 2007 3:10:57 PM]
  4. If a textured quad is clipped so it forms a polygon, how can the texture be applied to the triangles of the polygon, so the polygon's texture looks the same as it did on the quad? I am writing code to load a Quake 3 map file and I want to implement the same type of texture mapping. I have limited experience with OpenGL, and I'm thinking I'm going to need more than just: glTexCoord2f... Ideas?
  5. Hello, I am attempting to load the geomtry from a Quake 3 MAP file. I have decided this since it is very easy parse. However, primitives are described as plane intersections and I don't know how I should go about creating triangles from this data. This for instance describes a 1x1x1 cube, with one corner at (0,0,0) // entity 0 { "classname" "worldspawn" // brush 0 { ( 112 56 2 ) ( 112 16 2 ) ( 64 56 2 ) NULL 16 16 0 0.5 0.5 0 0 0 ( 80 2 87 ) ( 32 2 87 ) ( 80 2 -41 ) NULL 16 46 0 0.5 0.5 0 0 0 ( 66 39 96 ) ( 66 39 -32 ) ( 66 -1 96 ) NULL 18 0 0 0.5 0.5 0 0 0 ( 64 8 0 ) ( 112 8 0 ) ( 64 48 0 ) NULL 16 0 0 0.5 0.5 0 0 0 ( 40 0 -32 ) ( 40 0 96 ) ( 88 0 -32 ) NULL 0 0 0 0.5 0.5 0 0 0 ( 64 8 -32 ) ( 64 48 -32 ) ( 64 8 96 ) NULL 0 -0 0 0.5 0.5 0 0 0 } } The only thing I can think of is finding the intersection of each plane with the other planes and come up with a bunch of lines. Then intersect these lines with each other to get a bunch of points. From these points generate the required triangles. Ideas? [Edited by - AsOne on August 19, 2007 6:04:13 PM]
  6. AsOne

    Hash Map implementation

    This may be of some help: Perfect Hashing
  7. AsOne

    Precision stop in FMOD

    Once you begin playing a sound: FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel); You can stop the sound by using: FMOD_Channel_Stop(channel); Nearly the same using the C++ API as well.
  8. AsOne

    Why Linux?

    apt-get (Debian)
  9. AsOne

    PI * 13.37

    Well I knew that they had to be integers for PI to be rational, I just find it strange that this means that the circumference or diameter is irrational. It would seem that the circumference is most likely the one that is not rational. i.e. there can't be a perfect circle, or maybe I'm completely wrong.
  10. AsOne

    X-Games and Extreme Sports!!

    That was ridiculous! I have never seen a skateboarding bail that big.
  11. AsOne

    PI * 13.37

    OK, this is probably going to sound stupid, maybe a bit off topic, but... PI is an irrational number; however, we all know it's the ratio of the circumference of a circle to its diameter. PI = c / d But isn't any number that can be expressed as a fraction a rational number? Does this mean that the circumference or the diameter of a circle isn't a rational number? No one has ever explained this to me.
  12. AsOne

    lisp and large arrays

    Ah, no wonder it wasn't working. Those should obviously be i's and j's. Thanks.
  13. AsOne

    lisp and large arrays

    OK, This is set-color defun set-color (image j i blue green red) (setf (aref (bitmap-buffer image) (+ (* j 3) (* (bitmap-image-height image) i) 0)) blue) (setf (aref (bitmap-buffer image) (+ (* j 3) (* (bitmap-image-height image) i) 1)) green) (setf (aref (bitmap-buffer image) (+ (* j 3) (* (bitmap-image-height image) i) 2)) red)) I am hoping I did this correctly. In C, each pixel was a structure of 3 bytes. In Lisp I didn't know if a large array of structures would be very efficient so I did this instead. Maybe not such a good idea. Here is the bulk of the code that would be causing the problems, my Lisp style is probably bad so I apologize in advance ;) (defun filter (image modifier selector) "apply a filter to a bitmap" (let* ((buffer (bitmap-buffer image)) (image-width (bitmap-image-width image)) (image-height (bitmap-image-height image)) (out-image (make-bitmap :buffer (make-array (* image-width image-height 3) :element-type '(unsigned-byte 8) :fill-pointer nil) :image-width image-width :image-height image-height))) (loop for j from 0 to image-width by 1 do (loop for i from 0 to image-height by 1 do (if (and (or (eq selector nil) (funcall selector buffer j i)) (not (eq modifier nil))) (multiple-value-bind (b g r) (funcall modifier image j i) (set-color out-image j i b g r)) (Multiple-value-bind (b g r) (get-color image j i) (set-color out-image j i b g r))))) out-image)) ; return (defun modifier-average () "blur pixel modifier" (lambda (image j i) (let ((buffer (bitmap-buffer image)) (image-width (bitmap-image-width image)) (image-height (bitmap-image-height image)) (blue 0) (green 0) (red 0) (count 0)) (loop for y from (if (/= i 0) (1- i) i) to (if (/= i (1- image-height)) (1+ image-height) i) by 1 do (loop for x from (if (/= j 0) (1- j) j) to (if (/= j (1- image-width)) (1+ image-width) j) by 1 do (multiple-value-bind (b g r) (get-color image j i) (setq blue (+ blue b)) (setq green (+ green g)) (setq red (+ red r))) (setq count (1+ count)))) (setq blue (/ blue count)) (setq green (/ green count)) (setq red (/ red count)) (values (floor blue) (floor green) (floor red))))) This is used like this: (setq image2 (filter image1 (modifier-average) nil))
  14. AsOne

    'Must have' tools

    Anything free is good. For Windows: - Crimson Editor - Basic text editing features, syntax highlighting, standard stuff. It lets you customize color schemes really easily including changing what keywords get highlighted what. I tried to customize my color scheme in VS and gave up after 10 minutes. For Linux: - Emacs I first hated Emacs, but I recently started doing work with Lisp and now I can't live without it. The odd key combinations become second nature fairly quickly. Lots of choices for color schemes. - KATE (KDE Advanced Text Editor) Probably THE best basic text editing tool there is IMO. Others: - apt-get - gcc - KDevelop
  15. AsOne

    Pointer table

    You can bust out the void**, but it's dangerous! void **table = malloc(sizeof(void*) * TABLE_SIZE); int a = 10; float b = 20; table[0] = (void*)(&a); table[1] = (void*)(&b); printf("a = %d\n", *((int*)table[0])); printf("b = %f\n", *((float*)table[1])); free(table); This is scary though because you may not know how to cast each table entry to retrieve something meaningful. If you are using C++ it would be better to use std::vector like the poster above.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!