?
Solved

Rect redrawing

Posted on 2001-07-10
5
Medium Priority
?
289 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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 …
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

770 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