Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Hrolf

Pages: 1 2 3 [4] 5 6
46
Support / Re: Puzzled by Project3D2D
« on: September 26, 2008, 06:56:18 pm »
Here's (part of) the buffer showing spheres at the origin and on the x,y,z axes;

but
Code: [Select]
SimpleVector svp=Interact2D.projectCenter3D2D(renderBuffer,originSphere);and
Code: [Select]
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0,0));both return null!

The sphere is clearly on screen so why doesn't projectCenter3D2D or project3D2D give me the screen co-ords?

47
Support / Re: Puzzled by Project3D2D
« on: September 26, 2008, 05:41:42 pm »
The project3D2D returns null or are you getting a NullPointerException??
It returns null...

This gets stranger - if I try;
Code: [Select]
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0.0000001,0));I get the frameBuffer center, but if I try;
Code: [Select]
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,-0.0000001,0));I get svp==null!

I know everything's set up right because if I put an Object3D at 0,0,0 it renders correctly. It's a mystery to me!


48
Support / Puzzled by Project3D2D
« on: September 26, 2008, 05:02:51 pm »
I can't work this one out at all...

Code: [Select]
camera.setPosition(new SimpleVector(0,-100,100));
camera.lookAt(new SimpleVector(0,0,0));
world.setCameraTo(camera);
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0,0));

I expected svp to contain the center of the frameBuffer, but it returns 'null'.
What am I doing wrong?  ???

49
Projects / Re: Finally...
« on: April 15, 2008, 01:56:16 am »
Tsk! Does no-one know what snorks are? What do they teach in schools nowadays? *mutter, mumble*

Created by the wonderful Finnish authoress Tove Jansson in 1946: http://www.geocities.com/lindashippert/moomin/moominnf.html#extended

(game looks good BTW :))

50
Support / Re: Google sketchup support
« on: April 04, 2008, 03:46:29 am »
Top stuff Paulscode!

51
Support / Re: How to draw a line...
« on: April 04, 2008, 03:35:48 am »
Here's the code I used;

Code: [Select]
public Object3D createLine3D(SimpleVector from, SimpleVector to)
{
Object3D object=new Object3D(4);

SimpleVector delta=to.calcSub(from);
SimpleVector zaxis=delta.getRotationMatrix().getZAxis();
zaxis=zaxis.normalize();
zaxis.rotateY(1.571f);
SimpleVector from1=new SimpleVector(from);
from1.add(zaxis);
SimpleVector to1=new SimpleVector(to);
to1.add(zaxis);
object.addTriangle(from, 0, 0, from1, 0, 1, to1, 1, 1);
object.addTriangle(to1,1,1,to,1,0,from,0,0);
from1=new SimpleVector(from);
from1.y-=2f;
to1=new SimpleVector(to);
to1.y-=1f;
object.addTriangle(from, 0, 0, from1, 0, 1, to1, 1, 1);
object.addTriangle(to1,1,1,to,1,0,from,0,0);
object.build();
object.setCulling(Object3D.CULLING_DISABLED);
return object;
}


52
News / Re: Software renderer and Java6 Update10
« on: March 10, 2008, 05:02:27 am »
OK I voted for it! That's bad news for me!  :(

53
News / Re: Software renderer and Java6 Update10
« on: March 08, 2008, 10:46:53 pm »
Ulp! Will this affect Runescape & Bloodridge?  :-[

54
Support / Re: applet site
« on: February 18, 2008, 04:05:58 pm »
Any kind of site will do for an applet - they're treated pretty much like images.  :)

55
Support / Re: How to make quality better in sw mode...
« on: January 30, 2008, 07:07:31 am »
Here's the code I used in Bloodridge;

Code: [Select]
/*****************************************************************************
 ****************************************************************************/
  public void switchRenderQuality(boolean on)
  {
    m_hiResRender=on;
renderBuffer.dispose();
    if (m_hiResRender)
    {
    bufferWidth*=2;
    bufferHeight*=2;
}
else
{
    bufferWidth/=2;
    bufferHeight/=2;
    }
    renderBuffer=new FrameBuffer(bufferWidth, bufferHeight, FrameBuffer.SAMPLINGMODE_NORMAL);
    renderBuffer.enableRenderer(IRenderer.RENDERER_SOFTWARE);
      renderBuffer.setBoundingBoxMode(FrameBuffer.BOUNDINGBOX_NOT_USED);
      renderBuffer.optimizeBufferAccess();
  }

56
Yeah, I used 'pseudo-shadows' - a partially transparent texture rendered at the character's feet. If shadow detail is really important you could make a series of pseudo-shadows, one for each keyframe of your character's animation.
For static objects (trees &c) I made ground textures with the shadow already drawn on.

57
News / Re: New version of...myself!
« on: December 17, 2007, 01:16:48 am »
Congratulations! Very best of wishes for little Egon/Egonnetta - have you thought of a name yet?

58
Support / Re: Calculate Volume?
« on: December 13, 2007, 06:30:32 pm »
If time isn't a problem you could use the method they use in stone carving;

Pseudocode;
    modelVolume=BBoxVolume;
    For each face of the bounding box (ie +X by YZ, -X by YZ, +Z by XY, &c)
        scan the BBox face in smallUnits (use 2 nested for loops)
        use dist=calcMinDistance to get distance from the point on the BBox face to the model
        modelVolume-=small unit * smallUnit * dist

The smaller smallUnit is, the slower it is but the closer the result is to the actual volume...

This method only really works properly on convex models!

59
Support / Re: Several hundred characters
« on: December 03, 2007, 05:19:19 pm »
That's pretty nearly what I thought I'd have to do, but I thought of rendering all the models facing in (say) 8 directions to images at startup for billboarding, then discarding the models. I hadn't thought of mixing both at runtime. Thanks!

60
Support / Several hundred characters
« on: December 02, 2007, 02:52:53 am »
I'm thinking about a wargame with lots of agents - several hundred at least - and how to display them. The 3D view would never show more than (approx) 100 agents as you can never see the whole map in 3D. What's the best way to do this? I want 2 armies with 5 different soldier types, so only 10 actual models, but 100s of instances all in potentially different poses (think Age of Empires &c). Is there an optimal way of doing this in jPCT for realtime 3D display?

Pages: 1 2 3 [4] 5 6