SNARG

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

108 Neutral

About SNARG

  • Rank
    Member
  1. Could be gldepthfunc, try using GL_ALWAYS?
  2. Wow thanks,  never seen that before, any ideas for it's use? (The program being ported is used to create unfolded nets from 3D geometry.)   FYI, I think the normals are negated not the distance.
  3. Given the vertices for a poygon (tri or quad) , the face vertex list, and the normal for the polygon, a single floating point number is also given. Question is what does the value relate to?   example 1 v1   30.9, 234.51, -4.32 v2   -114.77, 117.93, 36.38 v3   52.97, 117.93, 145.31 normal   -0.390294  0.697474, 0.601 unknown value  -148.91   example 2 v1 -59.72, 163.79, 98.19 v2 -5.21, 177.91, 16.89 v3 10.44, 119.18, 88.13 normal   0.520179, 0.711538, 0.472364 unknown value   -131.862   We are porting a viewer to linux and mac, the unknown value isn't essential for the program, just wondering what it is.  
  4. Thanks guys, your fantastic.   Dot product method works to 0.1 degrees (floating point errors at 0.01 degrees).
  5. I have two polygons which share two vertices, and the normals for both polygons.   What I need to determine is whether the shared line between the polygons is a mountain or valley, ie the surfaces point away from each other or towards each other.   Finding the angle between the normals is easy:  angle = arccos(dotproduct(N1,N2)) I can't seem to find a simple solution to determine the sign of the angle. I have tried the atan2 method but this doesn't work, I keep getting an unsigned angle. There is also a method online (angle between two vectors) that requires the comparison between the cross product of two vectors and the original normal to the plane, but since there isn't a plane, the normal (to the normals) is calculated using the cross product, so only ever compares to itself.   I've tried a method of adding the normals to the centers of the polygons and measuring the distances between them, this works most of the time but fails when using acute angles.   Is there an equation that will give me the signed angle? or any other method that can determine if the line is a mountain or valley?   Thanks.    
  6. That matrix is perfect. vertex 4 { -55.1937 -10.6140 -129.7729 ... for UV(0,0) 55.1937 -129.5679 -12.8772 ...for UV(1,0) -55.1937 129.5679 12.8772 ...for UV(0,1) EDIT: got these 2 55.1937 10.6140 129.7729 ...for UV(1,1) UV's mixed up. Corrected. } Mistake was not applying the + - + matrix before the transpose. And did BxA instead of AxB. REALLY BIG THANKS for that method and spending the time to go through explaining it and checking the answers. Very very appreciated, not only by me but the hundreds of others who will be using it as well. [Edited by - SNARG on May 9, 2010 11:32:03 PM]
  7. Can't get it to work :( Either i'm doing something fundamentally wrong, screwed up the inverse or it just doesn't work. Using a column vector, that's ok isn't it? Some real data if you want to try it. x,y,z -41.3953 -7.9605 -97.3297 uv(0.12500, 0.12500) x,y,z 34.4961 -45.9345 27.6143 uv(0.81250 0.43750) x,y,z -20.6976 39.8266 -4.0867 uv(0.31250 0.62500)
  8. Quote:Original post by samster581 The xyz part is a matrix of a triangle? If you took the inverse of such a matrix, what exactly would that represent? Yes, it's for a triangle, specifically to find the flat(or planar) projection of a UV textured triangle. @Pragma 10 years since I did any matrix maths so taking a while to work out the equations, simplify them and test it with real numbers, thanks for the inverse of a matrix btw OMG :-D Seriously, if this works, your a mega genius, how the hell did you figure out that solution? Guess it's knowing the power of matrices...
  9. Given 3 vertices in 3D space, each with a texture co-ordinate, how do you find the 3D co-ordinates of UV(1,1)(0,0)(1,0)and (0,1). Assuming the 3 texture co-ordinates are all different, < 1.0 and > 0.0. Sounds really simple until you try to work it out. :( Any help greatly appreciated.
  10. [java] File i/o speed

    Thanks, thought the time per bytes looked fishy. Different tests need doing, if the 40 clock cycles is correct it doesn't make sense to load the extra data, but then if you combine the files into a single package the caching of that package, by the OS, could negate the extra load time. The small file is a descriptor used to rebuild the 3D model, the larger file contains the 3D data as is, stored as signed SHORT. The 176 bytes compressed to 203 bytes, the larger one to 928. With the descriptor you get a built in skeleton at 1/5th the size of a standard 3D file so thinking in bandwidth terms you could either save a packet or have a much larger 3D world to play in. Could always use the descriptor to rebuild the model at the other end as part of the update. Wanted to know if it's worth rebuilding on the fly or use the processor time for other things. Cheers for that, the things you forget to think about when worrying about problems that don't exist.
  11. Trying to work out if calculating 3D data from a 176 byte file is faster than loading the data from a 1320 byte file. I've been doing some testing on the time it takes for my computer to read bytes from a file. I'm ignoring the file seek time and any calls to java.io because a file has to be read anyway. On average it takes 4.2ns to read each byte using datainputstream.read(abyte0, 0, i); 4.2ns per byte!!! Does that sound right? That is almost the same as my clock cycle so it must be fetching it from cache. Is there a better way to test this other than changing the file each time? Anyone know their byte read speed? I've read it's 40-50 clock cycles but need to know for sure.
  12. How to destroy Earth?

    The Raëlians built a series of low yield, massive nuclear bombs which were towed by barge across the ocean and dropped at the intersection of 3 tectonic plates. When they detonated them all simultaneously on april 20th 2079, the volume of water above ground zero forced the shockwave downwards, tearing a hole 800 miles across in the ocean floor. The resulting super volcano, tidal waves and global earthquake events killed 98% of the population. The earth now sits in a prolonged ice age, awaiting the day when once again, the light will fall upon this cold dead planet...