Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  SDK Support    window coordinate where the scene is painted
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
<petrut>
Posted
Hi,
I was wandering if I can get the window's location (x,y, width, height) where an object is painted.

Peter
 
Reply With QuoteEdit or Delete MessageReport This Post
<Niko>
Posted
what do you mean ? you want to know the 2D bounding box of the projection on the screen of the 3d bounding box of the object ?
you will have to do it yourself:
you can request the bounding box of a geometry:
IMTS_Geometry3d::GetObjBounds().
you will have to multiply it by the WorldMatrix of the instance which hold the geometry and by the camera matrix. then to project it to the screen. and compute the 2d bounds.
what are you trying to do ? picking ?
 
Reply With QuoteEdit or Delete MessageReport This Post
<petrut>
Posted
Thank you for your answer. I'm just trying to locate where the scene is displayed in the 2D window, and its size. How do I project it on screen after I multiply it with the WorldMatrix and the camera matrix?
 
Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of DavidR
Posted Hide Post
petrut
you may tell exactly where objects in a scene are located by looking at the MTX file. The declaration of the object is followed by its position and size...relative to the declared scene parameters.

Following this, the object location, size, color, opacity, etc may be animated and manipulated at will.

You might read the Viewpoint Experience Technology Deployment Guide for further enlightenment. Then, the Viewpoint Scene Interactors Reference Guide will make your head spin to understand, then to consider the possibilities.

hth
DavidR
 
Posts: 308 | Location: Atlanta Georgia | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
<petrut>
Posted
I'm not using a MTX file to define my scene. I'm using the SDK to display models in a custom application. I need to know where the model is displayed in the window to narrow down a search for the object.

Thaks
 
Reply With QuoteEdit or Delete MessageReport This Post
<Niko>
Posted
just divide x & y by z
and multiply y by the field of view, which is viewport width/viewport height.
that's it.
byt the way to compute the transformation of a 3d point from the scene in the 'viewport world',
you need to multiply by the - inverse - of the camera worldmatrix.
 
Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  SDK Support    window coordinate where the scene is painted