Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Rect redrawing

Posted on 2001-07-10
Medium Priority
295 Views
In all the samples of dx 8.0 whole render target(window or full screen) is redrawn. If we want to redraw only the rect enclosing the object. How can wee determine the coordinate of rect. Better explain with reference to any of sample.
0
Question by:Sumia
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2
• 2

LVL 2

Expert Comment

ID: 6276191
Do you want to draw a bounding box rectangle around an object or do you want to redraw just the rectangular area containing the object. Is this a 3d or a 2D application ie is this a direct3d or a directdraw query ? I am sorry ... I dont understand the question fully ... whould you please rephrase it and give more detail. The question can be answered in various ways ... but I want to be sure of the context of the question first.
0

Author Comment

ID: 6279166
I only want to determine the bounding rectangle in directx graphics or you can say direct3d in a 3d application. I have given the untransformed vertices and I want to reach the vertices used by the rasterrizer of directx graphics.
0

LVL 2

Expert Comment

ID: 6280137
Have u looked at the computeboundingbox command ?

D3DX8.ComputeBoundingBox
Computes a bounding box.

object.ComputeBoundingBox( _
PointsFVF As Any, _
NumVertices As Long, _
FVF As Long, _
MinArray As D3DVECTOR, _
MaxArray As D3DVECTOR)

Parts
object
Object expression that resolves to a D3DX8 object.
PointsFVF
Buffer containing the vertex data around which to calculate the bounding box.
NumVertices
Number of vertices.
FVF
Combination of flexible vertex format flags that describes the vertex format.
MinArray
D3DVECTOR type, describing the returned lower-left corner of the bounding box.
MaxArray
D3DVECTOR type, describing the returned upper-right corner of the bounding box.

Or do u want the actual algorithm to do it ?
0

Author Comment

ID: 6301395
dx graphics does not apply the transformations unless drawprimitive is called. As I have explained earlier that I want to know the transformed vertices(screen cordinates) when I have supplied the world co-ordinates . With compute bounding box the problem remains the same that it performs the calculations on vertex buffer we give to it. But how to obtain the vertex buffer that contains the transformed co-ordintate. I have seen a function ProcessVertices but I can not understand how it works.
0

Accepted Solution

GuyJohnston earned 300 total points
ID: 6374164
You might consider applying transformation matrix
directly to the object verticies rather than use the
world transformation matrix. This way the verticies
are transformed directly. You can then get the bounding
box from the transformed verticies.

Depending on what you are doing, you may have to create
a reference vertex array to compute your transformations
from.

I used this method in a flying saucer game and it worked
quite well.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
###### Suggested Courses
Course of the Month10 days, 9 hours left to enroll