Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 May 2012
Offline Last Active Dec 22 2013 12:07 PM

#5004421 DrawInstanced problem

Posted by on 27 November 2012 - 12:00 AM

Sorry, I guess you didn't understand.
You have this:(hypotetically)
VERTEX* vertexBuffer0;
INSTANCE* vertexBuffer1:

that 4th parameter change which one will be the SV_InstanceID data. If you say the 4th parameter is x, the hypotetical formula would be:
InstanceData = vertexBuffer1[SV_InstanceID + x];

I think this way is easier to understand.

#5000476 WM_INPUT raw mouse input

Posted by on 13 November 2012 - 12:02 AM

NVM, stupid error. LOL

#4995204 Making two vectors parallel

Posted by on 29 October 2012 - 05:56 PM

What do you mean by that? 2 vectors are parallel when they are proportionals, like (x, y, z) and (2x, 2y, 2z). just multiply the first by the factor of the length of both.

#4972444 Multiple render window + RayCircle intersection

Posted by on 22 August 2012 - 07:43 PM

first you compute the intersection from the ray with the plane that supports the circle, then you check if the distance from the collision point to the center of the circle is smaller than the radius.

And you need the same scene to apper on 2 different windows from a different point of view?

#4956354 In how much time you finish a DirectX book?

Posted by on 06 July 2012 - 09:51 AM

It depends a lot on the book, and on your free-time. Last Year I got one book on the holiday, I read it in 1 day(it had 800 pages). And last month I read a book on regular days, and that took me forever to read(it was the Knuth V2).

#4955140 DirectX 11 Model file

Posted by on 02 July 2012 - 07:55 PM

Hey guys, I am trying to develop a 3D game using DirectX 11 but I don't know which 3D model file should I use, which one do you think is the best one?? I am using 3D max.
Would be better to have more than 1 type?like one for the character, other for itens, and other for the terrain for example??
Should I create a custom file??If so how do I export from the 3D max?

#4948618 Engine performance optimization

Posted by on 12 June 2012 - 02:21 PM

Reduce the number of calls to drawing functions, grouping everything that has the same texture in one vertex/index buffer is one way to do it.
Organize the drawing order in a way you draw the close object first.(that way you will reduce the number of times you alter a pixel)
Limit the number of faces drawed, these one depends alot on your app.
Those are the main stuff you can do, of course there are a lot of more things you can do that I don't remember right now.

#4947135 Scaling Sprites trouble

Posted by on 07 June 2012 - 01:09 PM

Use this instead

pos1.x = 12;
pos1.y = 768 - 48 + 24;

D3DXMATRIX scale_matrix;
D3DXVECTOR2 scale(0.5f,1.0f); // 50% scale in then x-direciton only
D3DXMATRIX original;


window::sprite_obj->Draw( txt_manager.get_texture("hp"),NULL,NULL,NULL, D3DCOLOR_XRGB(255,255,255));

That tranformation you apply on the sprite is applied on all the information you provide in the Draw Function.

Basically you were scaling after you translate the image, you have to translate after you had it scaled