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

M

Misterysword

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!
 
A

Andrew Thompson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top