Jump to content
  • Advertisement

codpp

Member
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

146 Neutral

About codpp

  • Rank
    Member
  1. codpp

    Adjusting the direction

    Sorry, but if all vertices are translated by (-x,-y,-z), doesn't it mean all vertices become (0,0,0)? If so, does rotation still affect the vertices?
  2. Yes. Thanks. I will try using only a bone for now.
  3. In collada the skinning equation is : v += {[(v * BSM) * IBMi * JMi] * JW}  I'd like to clear something.. 1) BSM = bind shape matrix , located in the tag "bind_shape_matrix"? 2) IBMi = inverse bind matrix, located in "library_controller", the same number as the total number of the joints? 3) JMi = joint matrix. Is it animation matrix from <library_animation>, or world matrix or local matrix ? 4) For now I want to just change the model to another different 'pose'. The pose is defined in a keyframe in Blender. For now I only have two poses for my model. The first one is bind pose/rest pose at frame 0, the second is a different pose at frame 30. 5) To my understanding, animation matrix's(from "library_animation") purpose is to replace JMi in the skinning formula , in order to give the model a different 'pose'. If so, what's use of each joint's world matrix? And If BSM is an identity matrix, can it be ignored? 6) To get a bone's world matrix, can I just multiply its parent's world matrix by its relative matrix?   The joints found in <library_visual_scene> are local/relative matrix for each joint. What I have done to simply switch to another pose was , take the local matrix for the current bone and multiply it with only the world matrix of its parent(i mean not all the way to the root bone's world matrix, only by its parents). But I doubt the world matrix is used in the formula so I didn't use it. Then I send the inverse bind bone matrix and animation matrix and vertex weights to the shader, and use that formula. Since the BSM is an identity matrix I didn't use it nether. As for JMi, I replace it with the animation matrix. But the result is not correct. The model is completely distorted. I do the vertex skinning on vertex shader. For now there are three bones for the model. The snippet of code for skinning in vertex shader is the following `in vec4 position; // The vertice position uniform mat4 inver,inver2,inver3; // The inverse bind matrix for each bone(3 bones) uniform mat4 joint,joint2,joint3; // The animation matrix for each bone(directly from vec4 v = vec4(0,0,0,1); v+= ( weight1 * inver * joint * position) + (weight2* inver2 * joint2* position) + (weight3 * inver3 * joint3 * position); // all the inver are inverse bind matrix found in <library_controller>, all the joint are animation matrix from <library_animation> ` I use v as the final position. The result is that the model is completely distorted. What could likely be wrong here? Thanks very much.
  4. codpp

    a question

    This might be extremely stupid or idiotic or immature to ask. Why do some threads get many replies but some only get one or two people's answers?
  5. codpp

    field of view

    I meant depth of field, not field of view. sorry, it was a typo.
  6. codpp

    field of view

    hi, I'd like to know if there's any book or online tutorial that cover the subject of depth of field? I looked through google. All the tutorials I found are difficult to understand(I have questions about some parts). As far as I know there seems to be two major approaches to do the effect. One is render several times but expensive, the other is using framebuffer.
  7. codpp

    a basic question

    What are the fragments of each object that are rendered? Are they simply the rasterized pixel that match a single pixel on the screen? Also does the depth testing starts when a triangle has been rasterized?
  8. codpp

    alpha question

    I have tried sending a -= delta_time for that from the main application, but it seems that no matter how large a value i give it it always decreased too quickly, like a -= delta_time * 0.00001f. a is 1.0f.
  9. codpp

    alpha question

    I want to achieve a effect where a black image that covers the whole screen slowly fade away, revealing what's behind it, by decreasing its alpha value in its fragment shader. The way I do it is create a quad that covers the whole screen. Its texture is a complete black image. I declared a variable a whose value is 1.0, and a uniform dt for which i will send the delta_time, the difference between the last frame and the current frame, each frame. And then I subtracted dt from a, and used a as the alpha value for the final color's alpha value. But it seems that the result is the image is still completely black. I guessed the variable a is still 1.0. I'd like to ask if there's a proper way to fade away the black image?   fragment shader:       const GLchar* TextFsource2 = "#version 330\n       uniform float dt;  in vec2 textuv; uniform sampler2D textsampler;     out vec4  color; float a = 1.0;     void main() {  a -= dt; color = vec4 ( texture2D(textsampler, textuv).rgb, a ); } "
  10. I'm currently learning how to do shadow mapping from online tutorials. As far as I know, this technique involves  two passes from shader. The first one is from light's view, and store the final image into a depth texture, in which all pixels are actually just floating point of depth. The second pass is from camera's view using normal method.   The part I don't understand is why the technique compares these two final images with their depth values. Since the cameras' angles (camera's and light's) are different, how can they be compared? 
  11. I tried to load information about 3d model from a .obj file using opengl. But I noticed that some of them contain more than four vertices for a single face in f section. Does that mean that face is a rectangle not triangle? If so, is it possible to render it out? A portion of the obj file that contain four vertices for a face is below:   s off g polySurface11 polySurface12 usemtl initialShadingGroup f 1/1/1 15/25/2 16/27/3 3/3/4 f 3/3/5 16/27/6 46/78/7 19/31/8 f 5/5/9 14/24/10 7/7/11   f 15/26/12 1/9/13 20/33/14 21/34/15 2/10/16    Thanks.
  • 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!