Menu

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.

Show posts Menu

Messages - jaychang0917

#31
I wanna place an object at the bottom right corner of world with the following code, it doesn't work.

How to place object at specific location of world?


Texture waterMarkTexture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.logo_camino_white)), 128, 128));
      boolean isWaterMarkTextureAdded = TextureManager.getInstance().containsTexture("watermark");
      if (!isWaterMarkTextureAdded) {
        TextureManager.getInstance().addTexture("watermark", waterMarkTexture);
      }
      Object3D waterMarkModel = Primitives.getPlane(1, AppUtils.dp2px(context, 4));
      waterMarkModel.setTexture("watermark");
      int screenX = AppUtils.getScreenWidthPixels(context) - 20;
      SimpleVector position = Interact2D.reproject2D3DWS(world.getCamera(), frameBuffer, screenX, screenX);
      waterMarkModel.setOrigin(position);
      waterMarkModel.build();
      world.addObject(waterMarkModel);
#32
Yes, i figured out the problem, it is due to incorrect GL viewport. Thanks your suggestion.
#33
The watermark (orange icon) is a square image, but you see that it is stretched. The device's screen resolution is 2560x1440.

Also, seems there is some jaggies at bottom right corner of watermark.

Has any idea?

#34
Hi, I try to create a square image using the following code, i found that the object will be stretch in some device (i.e. full screen SurfaceView with different aspect ratio), how to keep the model in square? Thanks!


Texture waterMarkTexture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.watermark)), 128, 128));
      boolean isWaterMarkTextureAdded = TextureManager.getInstance().containsTexture("watermark");
      if (!isWaterMarkTextureAdded) {
        TextureManager.getInstance().addTexture("watermark", waterMarkTexture);
      }
      Object3D waterMarkModel = Primitives.getPlane(1, 16);
      waterMarkModel.setTexture("watermark");
      waterMarkModel.setOrigin(new SimpleVector(45, 55, 0));
      waterMarkModel.rotateX((float) (Math.toRadians(19.3)));
      waterMarkModel.build();
      world.addObject(waterMarkModel);
#35
Bones / Re: No animations found in collada file!
March 08, 2017, 04:55:56 PM
Quote
because typically exporters do not export skeleton without animation. no skeleton -> no programatic animation
Actually i have no idea what the animation defined in .dae file is about. My model is a human head, and i want to programatically animate the mouth based on facial landmarks detected. If i put a dummy animation in my .dae file, is the function of dummy animation only make exportation (.dae -> bones) works?
#36
Bones / Re: No animations found in collada file!
March 08, 2017, 04:53:30 AM
i am wondering why bones need the animations compulsorily? it is because there is a case that we animate the model programatically instread of playing a predefined animation.
#37
Bones / Re: No animations found in collada file!
March 08, 2017, 04:01:43 AM
In my .dae file, it defines some texture file paths like

<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
  <asset><contributor><author></author><authoring_tool>FBX COLLADA exporter</authoring_tool><comments></comments></contributor><created>2017-03-03T10:42:33Z</created><keywords></keywords><modified>2017-03-03T10:42:33Z</modified><revision></revision><subject></subject><title></title><unit meter="0.010000" name="centimeter"></unit><up_axis>Y_UP</up_axis></asset>
  <library_images>
    <image id="file3-image" name="file3"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file3.png</init_from></image>
    <image id="file2-image" name="file2"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file2.png</init_from></image>
    <image id="file6-image" name="file6"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file6.png</init_from></image>
    <image id="file5-image" name="file5"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file5.png</init_from></image>
    <image id="file1-image" name="file1"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file1.png</init_from></image>
    <image id="file4-image" name="file4"><init_from>file://D:/Project/myproject/sourceimages/mymodel/file4.png</init_from></image>
  </library_images>
...


How can i tell .bone where my texture are?
#38
Bones / Re: No animations found in collada file!
March 08, 2017, 03:30:09 AM
Quotethis has nothing to do with .obj format
you means that i can covert .obj to .bone format too?
#39
Bones / Re: No animations found in collada file!
March 07, 2017, 04:55:34 PM
Thanks raft. I will try and get back to you.

Also I saw a sample that uses .bone file format, is it faster in terms of loading the model? Is it similar with the serialization object format in jpct-ae? How can I covert my .dae file to .bone?

Does bone support .obj format?

Sorry, too many questions. Thanks.
#40
Bones / No animations found in collada file!
March 07, 2017, 10:48:12 AM
Hi, I am trying the sample "ProceduralAnimationSample", it throws the following exception when i use my own .dea file. I want to ask if the animations is necessary? It is because i animate the model programatically, so there is no predefined animations in the model.


Exception in thread "main" java.lang.IllegalArgumentException: ColladaStorage contains no skins.
at raft.jpct.bones.BonesImporter.importCollada(BonesImporter.java:52)
at bones.samples.ProceduralAnimationSample.initialize(ProceduralAnimationSample.java:84)
at bones.samples.AbstractSample.loop(AbstractSample.java:91)
at bones.samples.ProceduralAnimationSample.main(ProceduralAnimationSample.java:312)


Thanks!
#41
I'm also worry about the performance of further processing. Do you have another better approach?
#42
Thanks your great help!
#43
QuoteWhich device are we talking about here?
LG-D858
#44
I found that fps will be dropped from 60fps to 30fps when both camera texture and 3d model are rendered. Is there any improvement that I can make?
#45
QuoteWhy are you still mixing jPCT-AE and GL calls?
It is because I only found this way to render camera texture to the GLSurfaceView. Is there are method like "addStreamingBackground()" in jPCT-AE?

clearZBufferOnly
this works!!