Help with Directx9

Started by
9 comments, last by manshy51 15 years, 5 months ago
Hi I am new with directX and use it to make a demo but there is some obstacles in my way so i need someone to help me. I want to draw some object on the screen and i want them to be drawn at certain position on screen and never change despite of the position of the camera (like radar in most games and player inventories, etc....) . but the problem i have that, this objects are drawn but i can't see them because the camera was pointed to another position.so please help me if you can :) thanks in advance
Advertisement
double-post: http://www.gamedev.net/community/forums/topic.asp?topic_id=512531
But still there is no answer for both posts :D
One option is to switch to a vertex format containing D3DFVF_XYZRHW for when you are drawing your HUD elements (assuming you are using the fixed-function pipeline). Your coordinates are then considered already transformed by the pipeline, so your X and Y values become screen coordinates.

Another, I guess, would be switching to an orthangonal projection, but I'll let someone who knows more about that than me explain [smile].
Quote:Original post by manshy51
But still there is no answer for both posts :D


and x-posting will even decrease the probability with which people will help you, as it's penetrant and increases noise/signal-ratio , just as a future hint ;)
I can't make the Vertex Format contains D3DFVF_XYZRHW since i use the vertex to draw another objects that don't have constant position.
So i need another method i guess
Quote:Original post by manshy51
I can't make the Vertex Format contains D3DFVF_XYZRHW since i use the vertex to draw another objects that don't have constant position.
So i need another method i guess
What? Just have different vertices for different objects. You shouldn't use 6 vertices to make a quad (2 triangles) and then draw the same quad 10 times in different places, you should use 60 vertices and draw all 10 quads at once.

If you have objects that have a constant position, and ones that don't, then use two vertex formats.
Are there any other method; because setting vertex format to D3DFVF_XYZRHW doesn't allow me to use some DirectX Features like scaling and i want this object to be annimated
Moved to DirectX.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by manshy51
Are there any other method; because setting vertex format to D3DFVF_XYZRHW doesn't allow me to use some DirectX Features like scaling and i want this object to be annimated
Yes, change your projection and view matrices before rendering the HUD, so that the HUD is always drawn in the same place relative to the screen. For instance, you can set an orthogonal projection matrix which will let you work in screen space but still use transformations for your vertices.

This topic is closed to new replies.

Advertisement