Home »
Public Forums »
archive »
Re: Using trackball to rotate an image
Re: Using trackball to rotate an image [message #33108] |
Tue, 03 December 2002 09:17 |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Pushya" <pushyar@yahoo.com> wrote
> I could rotate a cube using trackball in all directions. I want to
> rotate a 3D image inside a cube. When i rotate the cube, the image
> inside the cube should also rotate. I want to do this using trackball
> object.
> Can anybody tell me if there's a way to set the cube as transparent
> and the 3D image inside the cube to rotate along with the cube?
Since you want your cube transparent can you draw your cube as a wireframe?
It would be much easier. Seriously.
If not, you'll need to texture map a 4 channel RGBA image onto 2 half cubes.
The half cubes will be 5 sided (open where they meet). You set the Alpha
values very low so the cubes are translucent. You then order the halves
such that the one farther away from your eye is always drawn first. This
can be tricky but is easy with my camera object. Every time the object is
moved you check the sign of the z component of the lookat vector. If it
changes you use the Move method of IDLgrModel to reorder your objects.
Google the group for "Pimento problems" for an explanation as to why you
need to do this.
As for your image, you'll need to texmap that onto a "billboard" (a 2d
polygon). Image objects don't have any geometry so they can't be
manipulated like other objects. Map your image onto a planar polygon
located inside your cube(s). If you are texture mapping your cube make sure
that your billboard is ordered correctly in your model:
back cube half, billboard, front cube half
When you flip the back and front cubes you'll need to keep your billboard in
the middle.
-Rick
|
|
|
Current Time: Wed Oct 08 17:36:24 PDT 2025
Total time taken to generate the page: 0.00535 seconds