Problem with Canvas3D

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with Canvas3D

gandalf
I have a working 3D Canvas on which I am displaying a stack of ColorCube (more like Rubik's Cube, see image.) and I am using MouseRotate class to rotate the cube. The Rotation works fine when I am moving the cubes towards myself (in the positive Z direction) but works erratically when I rotate it on the other side. (Please see the attached screenshots for more clarity.)

Please let me know if I can provide any other information from my side.Rotation Outwards
Rotation Inwards
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Canvas3D

gouessej
Administrator
Your frustum is too small to contain your rotated Rubik's cube.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Canvas3D

gandalf
Could you please guide me on how to resolve this problem?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Canvas3D

jmaasing
Check section 11.1

http://docs.oracle.com/cd/E17802_01/j2se/javase/technologies/desktop/java3d/forDevelopers/j3dguide/AppendixView.doc.html

You need to set the far clipping plane to be further away. I'm guessing this might do the trick (I don't use Java3D so just a guess):

http://download.java.net/media/java3d/javadoc/1.4.0/javax/media/j3d/View.html#setBackClipDistance(double)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Canvas3D

gouessej
Administrator
In reply to this post by gandalf
jmaasing is right. I advise you to learn some basic notions of computer graphics which is a prerequisite when using a 3D graphics API, especially if you don't know what a frustum is.
Julien Gouesse | Personal blog | Website