Jump to content

  • Log In with Google      Sign In   
  • Create Account

markypooch

Member Since 26 Mar 2013
Offline Last Active Yesterday, 01:45 AM

#5157343 Tweening Questions

Posted by markypooch on 01 June 2014 - 08:54 AM

Just a status update, thought you guys might like to know.

 

Though I haven't implmented Skinning yet, I did tweening to work after I implemented a hardware

version (did my tweening in HLSL) So I must have been doing something silly with the dynamic buffers.

 

Kinda off topic but the results aren't bad. (I still plan on doing skinning)

 

awd_zpsf7cbe856.png




#5156060 Tweening Questions

Posted by markypooch on 26 May 2014 - 12:29 PM

Hello all!

 

I started to look into tweening since it looked like a fun and sort of quick way to get some basic animations going on my meshes.

 

Well, due to the sake of simplicity I decided to implement it on the CPU side first with dynamic buffers. While performance is pitifull, thats to be expected when pushing data back and forth from the CPU to the GPU.

 

However, I've run into a issue that makes me ask

 

The OBJ format. I've heard that the blender exporter (correct me if im wrong) will rearrange the vertices from export to export. thus negating any tweening attempts. Since I most comfortable with the OBJ format is there a way around it (I see in the mesh export options in blender, keep vertex order) or is this just wishful thinking. If you think OBJ is a no go. What format do you recommend?

 

Also, my implementation is based on Advanced Animation with DirectX, i just stuffed all the values into XNA types.

I'm including my tweening implementation just in case I missed something silly that someone could hint to. (And also as a validation that this isn't completely off XD) And also because my meshes when tweening wig out and start rendering crazy polygonal shapes and colors! Also as if I'm referencing out-of bounds garbage memory and passing it to D3D

float time = 0.0f;
float length = 5.0f;
 
if (isMoving)
 {
        Time += 5.0f * dt;
        if (Time > 5.0f) Time = 0.0f;
 }
//Note: vertices[x].at(x) represents a vector of pointers which hold all the info of each subset of the overall mesh

scalar = Time / length;

D3D11_MAPPED_SUBRESOURCE ms;
                for (int i = 0; i < mCount; i++) //mCount = subsetMeshCount
                {
                    verticesResult.resize(verticeCount[i]);
                    for (int j = 0; j < verticeCount[i]; j++)
                    {
                        //Interpolate Positions
                        /////////////////////////////////////////////
                        XMVECTOR vecSource = XMLoadFloat3(&vertices[i].at(j).pos);
                        float value = (1.0f - scalar);
                        vecSource *= value;

                        XMVECTOR vecTarget = XMLoadFloat3(&vertices2[i].at(j).pos);
                        vecTarget *= scalar;

                        XMStoreFloat3(&verticesResult.at(j).pos, (vecSource + vecTarget));

                        //Iterpolate Normals
                        //////////////////////////////////////////////
                        XMVECTOR vecSourceNorm = XMLoadFloat3(&vertices[i].at(j).norm);
                        value = (1.0f - scalar);
                        vecSourceNorm *= value;

                        XMVECTOR vecTargetNorm = XMLoadFloat3(&vertices2[i].at(j).norm);
                        vecTargetNorm *= scalar;
                        XMStoreFloat3(&verticesResult.at(j).norm, (vecSourceNorm + vecTargetNorm));

                        verticesResult.at(j).norm               = vertices[i].at(j).norm;

                        //Pass along Materials
                        ///////////////////////////////////////////////
                        verticesResult.at(j).color                = vertices[i].at(j).color;
                    }

                    //Lock the dynamic buffer (block the GPU)
                    ///////////////////////////////////////////////////
                    bro->devcon->Map(vertexBuffer[i], NULL, D3D11_MAP_WRITE_DISCARD, NULL, &ms);

                    //Grab a pointer to the data, pass along update vertice info, and remap the buffer
                    ////////////////////////////////////////////////////////////////////////////////////
                    VertexM *v = reinterpret_cast<VertexM*>(ms.pData);
                    *v          = verticesResult[0];
                    bro->devcon->Unmap(vertexBuffer[i], NULL);
                }

Any replies are appreciated smile.png

 

-Marcus




#5146773 How does the screenshots look?

Posted by markypooch on 13 April 2014 - 04:06 PM

Hello all,

 

I would just like to thank everyone at this website and on the forums for helping me grow as a graphics programmer. It's been a long time coming, but now I think I want to post a picture and get some feedback regarding the scene.

 

Some things I will note

  

     The shadows are a little bit off (Still working on 'em)

     The HUD can use improvement (anybody have ideas ;) )

      The brief case holding flash's items still need some work

 

Anyhow, I love HONEST opinion's! So any feedback I'll gobble up!

 

-Marcus

 

Attached Thumbnails

  • 23.png
  • asdef.png
  • aseffgfsd.png
  • freeMon.png



#5115049 2D mouse (rotation in 3D world)

Posted by markypooch on 07 December 2013 - 12:45 AM

Hello Once More!

 

It looks like your previous post is pointing towards specular highlighting :D If I could get that working its gonna be awesome. But for the time being Im gonna show my revised results with the point lights AND shading and let me know if im  a step closer. (I want to be at least somewhat closer before attempting specular lighting)

 

8wy4.png

 

I think it looks a bit better. Let me know your opinion :) Once I get this to a decent point ill try specular highlights

 

-Marcus




#5113330 2D mouse (rotation in 3D world)

Posted by markypooch on 30 November 2013 - 02:11 PM

Yes, it does, quite well actually. My next step is to draw a cross hair in object space. That way you know what your shooting at.

 

And for some reason im picking up what your laying down.
Today must be one of those days

 

Im gonna give the projectile algorithm a shot (Get it :D)

 

-Marcus




#5113305 2D mouse (rotation in 3D world)

Posted by markypooch on 30 November 2013 - 12:54 PM

9iid.png




#5075795 Bump Mapping....almost

Posted by markypooch on 06 July 2013 - 03:29 PM

Nevermind I figured it out :D

 

turns out I wasn't setting the right stride in the IA call for the vertexBuffer

 

Thanks anyways!

 

-Marcus = Extremely Happy




PARTNERS