« Return to Thread: Trouble rendering with TBoundsphere

Re: Trouble rendering with TBoundsphere

by Phua Khai Fong :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
I have attached together the class of the cube I have. The rendering part is done by me but the picking and pointer events are mostly copied from TDragCube with very slight modifications. To create the cube, you will need to assign values to the instance variable zEnd & endPoint. Try creating the cube at all 4 directions (north, south, east and west) and move around it and see if any of the cubes disappears on and off. Let me know if you need further information.

Thanks.


----- Original Message ----
From: Andreas Raab <andreas.raab@...>
To: croquet-dev@...; Phua Khai Fong <kayef8@...>
Cc: Darius Clarke <socinian@...>
Sent: Wednesday, March 19, 2008 1:55:49
Subject: Re: [croquet-dev] Trouble rendering with TBoundsphere

Phua Khai Fong wrote:

> initBounds
>
>    | length x y z |
>    length := xLength max: (yLength max: (zEnd - zStart)).
>
>    x := xLength/2.
>    y := yLength/2.
>    z := (zEnd - zStart)/2.
>
>    boundSphere := TBoundSphere localPosition: (self startingPoint +
> (x@y@z)) radius: length.
>    boundSphere frame: self.
>
> As requested, the above is the message that instantiates the
> TBoundSphere and places it in the center of the cube. The variable
> length stores the longest side among the width, length and height of the
> cube which will then be the radius for the boundSphere.

Did you subclass TCube or write your own? The code above is nothing like
in the SDK so if you've written your own TCube implementation you'll
have to post all of it or else it's impossible to say what the problem
is. By rough glancing over it it looks as if the problem might be
related to the "self startingPoint + (x@y@z)" which could be
inconsistent with the rendering of the cube. Impossible to say with just
the above code though.

Cheers,
  - Andreas


Send instant messages to your online friends http://uk.messenger.yahoo.com

MyRectangle.st (15K) Download Attachment

 « Return to Thread: Trouble rendering with TBoundsphere

LightInTheBox - Buy quality products at wholesale price