kovacsv / JSModeler

A JavaScript framework to create and visualize 3D models.
MIT License
648 stars 124 forks source link

Is there a way in JSModeler to select a mesh object by mouse event? #26

Open udaydutta opened 7 years ago

udaydutta commented 7 years ago

I am just started looking at JSModeler. So far it is awesome to me. Previously I have used another Canvas/Webgl based 3D library named JSC3D. It is really lightweight compare toJSModeler. But It supports picking an mesh object by mouse event on the model. Does JSModeler provide that sort of functionality? If it does, I will appreciate if I get a sample code. It would help a lot to select a model component and edit that. Thank you very much. -- Uday

kovacsv commented 7 years ago

Hello,

What viewer do you use? JSM.Viewer or JSM.ThreeViewer?

Viktor

udaydutta commented 7 years ago

Victor - Thank you very much for your reply. As I told I have not really started using JSModeler for my project yet. I have just started exploring the library. I must say so far I have seen it is awesome. My project will be to build a Building Model from user input, that consists of Frame, Column, Rafters, Connectors, Walls, Girts, Roof, Purlins, Joist etc. After creating the model for each components of the building, which I understand will be pretty easy with JSModeler and It will be render on the screen for user interaction. Now user should be able to click (or double click) on any component on the viewing screen and identify the components id so that the other related information of the compentts could be viewed, prefereable by a JSON or database look up. Therefore I need to know about the following three things.

a. How to select a specific component from the rendered model and know the mesh id? In another library JSC3D that I used before that has the capability to select the specific rendered mesh. I guess, Three.JS also have the similer functionality.

b. I can see JSModeler has feature to add, delete a mesh model to existing model. What I need to know that does it already have a some sort of Model editing capabilities.

c. Last thing I need to know which I am not sure of that can we use the custom image as a texture on the model surface? I think it is already there. But I need some example code.

I will really appriciate if you help me by giving some heads up on my question. Once again thank you very much for developing this powerful and easy-to-use library.

Uday Dutta

On Sun, Feb 19, 2017 at 2:33 PM, Viktor Kovacs notifications@github.com wrote:

Hello,

What viewer do you use? JSM.Viewer or JSM.ThreeViewer?

Viktor

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kovacsv/JSModeler/issues/26#issuecomment-280946559, or mute the thread https://github.com/notifications/unsubscribe-auth/AYrH9wM7U03vHVOD5OeWHFDb2_rgTm8xks5reKcEgaJpZM4MFTLD .

-- Uday

kovacsv commented 7 years ago

Hello!

Basically JSModeler has two viewers. An internal one, and a three.js based. Both viewers can detect objects under the mouse, and the possibility to add or remove objects. Custom textures are also available.

I recommend you to check the sandbox folder for examples, and feel free to ask if you have any questions.

Viktor

udaydutta commented 7 years ago

Excellent! As recommended, I have looked into example "undermouse.html". It has perfectly explained what I wanted to know. I have also noticed that at renderBody object level it supports to add properties that really help to keep non-geometrical information right with the model object. Thank you very much for all the helps. JSModeler is really a very powerful and promising library.

One question though. Is there any plan to add "3D Shape Recognition", "Collision detection" or "Physics Modeling" type of features to JSModeler in the near future?

Thanks again.

UCD

On Mon, Feb 20, 2017 at 11:21 AM, Viktor Kovacs notifications@github.com wrote:

Hello!

Basically JSModeler has two viewers. An internal one, and a three.js based. Both viewers can detect objects under the mouse, and the possibility to add or remove objects. Custom textures are also available.

I recommend you to check the sandbox folder for examples, and feel free to ask if you have any questions.

Viktor

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kovacsv/JSModeler/issues/26#issuecomment-281136699, or mute the thread https://github.com/notifications/unsubscribe-auth/AYrH9zJJ6oRyhqlopMnX_s-zP6pRBCnIks5recuOgaJpZM4MFTLD .

-- Uday

kovacsv commented 7 years ago

Hello!

I'm glad you like JSModeler. Currently I have no plans to do the mentioned features in the near future, but who knows :)

Viktor

udaydutta commented 7 years ago

Hi! Victor Is it possible to disable/enable applying the transformation on a selected body in a model during mouse interaction? I am trying to display a Camera position with an array indicator ( May be a text or a SVG) on the scene and I do not want it to get it resized. Also I want to show the axis lines at Camera Center position. I want to keep length of axis lines constant but I would like to show the rotation of the axis.

Any tips will be appreciated.

On Tue, Feb 21, 2017 at 2:52 PM, Viktor Kovacs notifications@github.com wrote:

Hello!

I'm glad you like JSModeler. Currently I have no plans to do the mentioned features in the near future, but who knows :)

Viktor

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kovacsv/JSModeler/issues/26#issuecomment-281476436, or mute the thread https://github.com/notifications/unsubscribe-auth/AYrH96kcmtXSRVVdkxr-q5PnewNPb7TMks5re06MgaJpZM4MFTLD .

-- Uday