Divide Plane

Started by MegasXLS, February 16, 2011, 10:59:37 PM

Previous topic - Next topic

MegasXLS

Hello everybody,
I would like to know a way to divide my plan.
Is that when the user wants to move your character in the plane, he will click the character after that and asked where to direct the character. Similar to Dragon Mage project. I wanted to divide the plane so that when the mouse cursor passed over it a simple square changed color for the user to know where the character will.

Thanks in advance

MegasXLS

1 - What is the best way to click on a 3D object and clicking the I plan to move the object to that place? I want my character to move anywhere in the plan by clicking somewhere in the plane.

EgonOlsen

It might be a better idea to simply use a kind of marker instead of modifying the plane itself. Concerning your second question: What you need here is picking. The wiki has a page about it or you can have a look at (for example) this thread: http://www.jpct.net/forum2/index.php/topic,1932.0.html

MegasXLS

How i use this Marker?
thanks for the answer.

EgonOlsen

Create another, smaller plane and place it where you want to...just get creative.

MegasXLS

True. It Worked.

Olsen, I'm trying to make my character in the format MD2 get animated. I'm using the AdvancedExample snork. When my desktop application was able to animate it using the method of AdvancedExample animate well, but in the applet it does not get animated. He is already being shown usually along with other objects, but not animated.
You know why?

thanks

EgonOlsen

Most likely because you did something wrong. Impossible to say without seeing any code.

MegasXLS

Tradução do português para inglês
Oh, I call the method animate(ticks) in the run method of my applet.

public void run(){
       long ticks = 0;
       while (loop){
           this.repaint();
           
           try{
               Thread.sleep(10);
           }catch(Exception e){
                           }
           ticks = ticker.getTicks();
           if (ticks > 0) {
              animate(ticks);  
              move(ticks);
             
           }
       }
   }

MegasXLS

public void animate(long ticks) {

      if (ticks > 0) {

         float ft = (float) ticks;
         ind += 0.02f * ft;
         if (ind > 1) {
            ind -= 1;
         }

         snork.animate(ind, 2);
}

MegasXLS

I have tested animate(ticks) in my method public void paint( Graphics g ) but not worked too. =(

MegasXLS

Olsen Thanks for the help.

I managed to animate the snork.
Trade the instructions:

snork.compileAndStrip();

for

snork.compile (true, false, true, false, 1000);


EgonOlsen

Yes, compile() or compileAndStrip() don't work for animated objects. But that can't be taken from the Advanced Example!?

MegasXLS

Yes, but I changed that instruction in some tests and ended up not changing back. ^^" y