Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / DBP// 2D of 3D

Author
Message
RadiusOFT
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Aloha, OR(egon)
Posted: 27th Jun 2006 07:33 Edited at: 27th Jun 2006 08:32
is there a command in DBP that can get the 2D height and the 2D width of a 3D Object? i tried looking in the help but had no luck.
thanks

Do or do not... there is no try -yoda
cats fit best in a george forman - not yoda
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 27th Jun 2006 08:44
object size x(), y() and z() will return the size of the object, but I'm not exactly sure what kind of numbers they return and I would never trust them. I'm assuming you're asking for the height and width and length of the object, which are not 2D. Well...lengths are technically 2D, but it's a strange way of asking for the object's height, I think.

Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 27th Jun 2006 14:06
Do you mean the heigh and width viewed from a perspective, rather than the actually straight-on height and width?
RadiusOFT
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Aloha, OR(egon)
Posted: 27th Jun 2006 22:17
To anrwer deaths question,yes

Do or do not... there is no try -yoda
cats fit best in a george forman - not yoda
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 27th Jun 2006 22:43
Oooh, you want the on screen height and on screen width of the object.

Nope, no commands to do that.

RadiusOFT
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Aloha, OR(egon)
Posted: 27th Jun 2006 23:02
crap

Do or do not... there is no try -yoda
cats fit best in a george forman - not yoda
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 27th Jun 2006 23:12
You could work out the position of every vertex on screen using a temp object, and then find the smallest/largest x/y, but this would be quite slow.

<OMG></OMG>
NeX, you cant be serious - CattleRustler.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 28th Jun 2006 14:57 Edited at: 28th Jun 2006 14:59
Make a dummy object. Position it on all 8 corners after eachother, and get their 2D position using object screen x() and object screen y(). The difference between the outer values, will be the width and height.

It's faster than getting every vertex, but less accurate.
It also gets very difficult if you're starting to rotate around X and Z axis.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Jun 2006 01:11
translate four 3d points into 2d then do subtraction.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike

Login to post a reply

Server time is: 2024-11-26 17:37:11
Your offset time is: 2024-11-26 17:37:11