Solved

Rect redrawing

Posted on 2001-07-10
5
286 Views
Last Modified: 2013-12-26
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
Comment
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
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:cybermike3d
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

by:Sumia
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

by:cybermike3d
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

by:Sumia
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

by:
GuyJohnston earned 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question