Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Question about JAVA 3D: Points to intervale [-1,1]

Thread view: 
Misterysword@hotmail.com - 10 Apr 2007 11:51 GMT
Hi!! I have got points like this (in a file): X=2,923, Y=-0,232,
Z=7,890.

In Java 3D, points must be between -1 and 1 (in a intervalo [-1,1]).
How do you change this points to intervale [-1,1] ????

Regards!
Andrew Thompson - 10 Apr 2007 12:52 GMT
>Hi!! I have got points like this (in a file): X=2,923, Y=-0,232,
>Z=7,890.
>
>In Java 3D, points must be between -1 and 1 (in a intervalo [-1,1]).
>How do you change this points to intervale [-1,1] ????

1) Calculate what maximum scale is required to
include all points.
- find xMax.absoluteValue, yMax.absVal and zMax.absVal
- use the largest of the three - call it scaleMax
- if you want some 'space' around the object, add 10%
to scaleMax.
2) Scale the vaules to fall between -1 & 1 by
- divide every value by scaleMax

As an aside, please fix that sticky '?' key.  One
question mark is enough.

Signature

Andrew Thompson
http://www.athompson.info/andrew/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.